Welcome Guest ( Log In | Register )


 
Reply to this topicNew Topic
Copying files to an alternate location
rockstar
post Nov 17 2008, 09:18 PM
Post #1


Contributor
**

Group: Members
Posts: 10
Joined: 17-November 08
Member No.: 189


I need to have files copied from my default Gateway directory to some other Gateway filesystem as soon as these files are received by the Gateway. How should I proceed? (Version: XFB.Gateway 6.8 under Solaris)
Go to the top of the page
 
+Quote Post
Samir KHERZI
post Nov 18 2008, 11:09 AM
Post #2


Contributor
**

Group: Members
Posts: 11
Joined: 6-November 08
From: Paris
Member No.: 86


Hi rockstar,

You need to create a Decision Rule depending on the expected behavior and by selecting either batch command or PERL script.

In your batch command, use environment variables to move the file to the new location:
For example on UNIX:
------------------------------------------
#!/bin/sh

mv $x_path_name /your/new/location
------------------------------------------

See what are the available environment variables in the provided sample:
UNIX: xpr.sh
Windows: xpr.bat

I hope it helps.

- Samir

Go to the top of the page
 
+Quote Post
rockstar
post Nov 18 2008, 05:33 PM
Post #3


Contributor
**

Group: Members
Posts: 10
Joined: 17-November 08
Member No.: 189


Thanks Samir, this sure helps me get some leverage with the product.
Go to the top of the page
 
+Quote Post
rockstar
post Nov 18 2008, 08:51 PM
Post #4


Contributor
**

Group: Members
Posts: 10
Joined: 17-November 08
Member No.: 189


Is there a way to store the initial filename of the transferred file along with the file identification somewhere so that the file can be renamed to its original name once it is copied to its new location? This specific detail seems to be missing in the xper.sh sample script.
Go to the top of the page
 
+Quote Post
Samir KHERZI
post Nov 19 2008, 10:04 AM
Post #5


Contributor
**

Group: Members
Posts: 11
Joined: 6-November 08
From: Paris
Member No.: 86


I'm not sure, I think it's $x_file_name

If you want to see an environment variables, do a simple xpr.sh:
---------------------------------------------
#!/bin/sh

env >/path/to/a/writable/directory/env.out
---------------------------------------------

and see the result in the env.out.

You should be able to identify the variable you need ;-)

- Samir
Go to the top of the page
 
+Quote Post
rockstar
post Nov 19 2008, 06:17 PM
Post #6


Contributor
**

Group: Members
Posts: 10
Joined: 17-November 08
Member No.: 189


The initial filename doesn't show anywhere in the output of xpr.sh and $x_file_name is getting the value of "idf". This is the command that triggers the file transfer on my client box:
"cftutil.exe send type=file,fcode=binary,ftype=b,part=server1,idf=CIE_XGC_DEVL,
fname=d:\prod\gpx\data\xgc.csv"
The funny thing is that the filename is displayed by default if a batch command is not called by the decision rule. xpr.sh shows all kinds of file statistics, but no initial filename, so I suspect some transfer parameter is missing.
Go to the top of the page
 
+Quote Post
jmmahieu
post Nov 20 2008, 12:36 PM
Post #7


Contributor
**

Group: Members
Posts: 14
Joined: 6-November 08
From: Puteaux
Member No.: 140


Hello,

Try to use x_file_label but it will depend on the protocol. But as far as I have understood your file has been sent by CFT so if it is, file_label will be the right variable.


--------------------
JM MAHIEU
Go to the top of the page
 
+Quote Post
rockstar
post Nov 21 2008, 03:40 PM
Post #8


Contributor
**

Group: Members
Posts: 10
Joined: 17-November 08
Member No.: 189


QUOTE (jmmahieu @ Nov 20 2008, 07:36 AM) *
Try to use x_file_label but it will depend on the protocol. But as far as I have understood your file has been sent by CFT so if it is, file_label will be the right variable.


No luck with x_file_label either. I'm still looking for just about any kind of workaround at this stage.
Below is the output of "xpr.sh". I see in it that "Protocol file name", x_application and x_file_name are identical (the value of CFTUTIL's IDF). The initial transferred file name is not showing anywhere, though.

Here's the Decision Rule:
direction = I
file name =CIE_XGC_DEVL
mode = R
originator = *
protocol = PHSE
remote agent = *
type = TRANS



CODE
COMMAND LINE
------------
/tmp/test.sh

-----------------------------
TRANSFER REQUEST INFORMATIONS
-----------------------------
// Transfer Identification
Transfer identification       : 162455
Direction                     : I
Connection mode               : R
Type                          : TRANS
// Transfer state
State of transfer             : E(ENDED)
Last end reason               : 0
Last end protocol diagnostic  : 0
Last end local error          : 0
// File Identification
Local file name               : /server1_fs03/XFB/Gateway685/run_time/tmp/F0162455
File originator               : DENV03-client001
File destination              : server1
File originator alias         : DENV03-client001
File destination alias        : server1
// File Attributes
File organisation             : S
File size                     : 13824
File record count             : 27
File allocation unit          : K
File allocation size          : 14
File creation date            : 20081121 095951
File extraction date          : 20081121 095951
File Character set            : B
Record format                 : S
Record length                 : 32000
text file ?                   : N
// Protocol Parameters
Protocol used                 : PHSE
Protocol file type            : 0
Protocol file name            : CIE_XGC_DEVL
Protocol transfer id          : 2609595
// Transfer Statistic
Date of creation              : 20081121 095951
Date to begin                 :
Date to end                   :
Transfer started on           : 20081121 095951
Transfer ended on             : 20081121 095951
Number of retries             : 0
Number of bytes transfered    : 3294
Number of file bytes transfer : 13824
Priority                      : 1
Julien day                    : 326
Sequence number               : 124
Compression                   : B
Remote agent                  : DENV03-client001
Local agent                   : server1
Application                   : DEFAULT_B
Retry count max               : 5
Gateway type                  :
Acknowledgment option         :
Negative acknowledgment       :
Route state                   : PROCESSING
User state                    :
Directory name                :
Transfer record format        : V
Transfer record length        : 512
Padding                       : 00
Truncating allowed            : N
Transfer data code            : B
Key length                    : 0
Key offset                    : 0
Block size                    : 0
Sys dep                       :
File ciphered                 : N
File label                    :
Interval                      : 0
User name                     : admin
Send message                  :
Receive message               :
Master ident                  : 0
Diffusion list next xfer      :
Diffusion list nb total       : 0
Diffusion list nb ended       : 0
Diffusion list nb to begin    : 0
Diffusion list nb canceled    : 0
Diffusion list nb frozen      : 0
Diffusion list nb suspended   : 0
Diffusion list nb progressing : 0
Purge option                  : N
User Processed                : N
Unique filename               : N
Permanent                     : N
Total requests                : 0
Total Files                   : 0
Maximum requests              : 0
Maximum files                 : 0
Duplicate from transfer       : 0
Route from transfer           : 0
Route to transfer             : 0
Reply by transfer             : 0
Reply to transfer             : 0
Route remote agent            :
// FTP Parameters
Command                       :
Append                        : N
// FTP Parameters
Request method                :
// XNTF Parameters
Filter                        : ALL
Profile                       :
// Security Parameters
Sprof                         :
Cipher suite                  :
Client auth                   : N
Server auth                   : N
// Pesit Parameters
Select request                : 0
Previous transfer             : 0
Next transfer                 : 0
Sender user                   :
Sender appli                  :
Sender text                   :
Receiver user                 :
Receiver appli                :
Receiver text                 :
// User Parameters
User message 1                :
User message 2                :
User parameter 1              :
User parameter 2              :
Script Name                   :
// Sentinel Parameters
Object name                   : XFBTransfer
CycleId                       :

------------------------------
     AVAILABLE PARAMETERS
------------------------------
x_DATE=20081121
x_TIME=095951
x___full_state=ENDED
x_acknowledgment_option=
x_alloc_count=14
x_alloc_size=14
x_alloc_unit=K
x_append=N
x_appli=DEFAULT_B
x_appli_user_param1=
x_appli_user_param2=
x_application=CIE_XGC_DEVL
x_attach_extract_file=U
x_block_size=0
x_called_addr=10.100.244.206
x_cgate_user_param1=
x_cgate_user_param2=
x_compression=B
x_content_type=
x_counts_0=0
x_counts_1=0
x_counts_2=0
x_counts_3=0
x_counts_4=0
x_counts_5=0
x_counts_6=0
x_counts_7=0
x_counts_8=0
x_counts_9=0
x_create_date=20081121 095951
x_data_code=B
x_date_begin=20081121 095951
x_date_create=20081121 095951
x_date_end=20081121 095951
x_date_to_begin=
x_date_to_end=
x_dest_alias=server1
x_destination=server1
x_dir_name=
x_dir_path=/server1_fs03/XFB/Gateway685/run_time/tmp
x_dir_type=
x_direction=I
x_dup_from_xfer=0
x_etb5_auth_type=UNUSED
x_etb5_ciph_type=UNUSED
x_etb5_id_bank=
x_etb5_id_bank_sec=
x_etb5_id_client=
x_etb5_id_client_sec=
x_etb5_memo_type=UNUSED
x_etb5_paraf_used=N
x_etb5_rsign1_used=N
x_etb5_rsign2_used=N
x_etb5_seal_type=UNUSED
x_etb5_sign_type=UNUSED
x_etb5_userarea=
x_extract_date=20081121 095951
x_f_bytes=13824
x_file_ciphered=N
x_file_component=F0162455
x_file_label=
x_file_name=CIE_XGC_DEVL
x_file_org=S
x_file_size=13824
x_file_sys_dep_param=
x_file_type=0
x_ftp_command=
x_full_state=ENDED
x_generate_xfb_subject=U
x_group=GDEFAULT
x_http_host_name=
x_ident=2609595
x_integer_user_param1=0
x_integer_user_param2=0
x_integer_user_param3=0
x_integer_user_param4=0
x_integer_user_param5=0
x_interval=0
x_key_len=0
x_key_offset=0
x_last_end_diag=0
x_last_end_err=0
x_last_end_reason=0
x_local_agent=server1
x_local_ident=162455
x_master=0
x_max_alloc_size=14
x_max_file=0
x_max_files=0
x_max_request=0
x_max_requests=0
x_message_id=
x_mode=R
x_msg1=
x_msg2=
x_nack_action=
x_nb_canceled=0
x_nb_ended=0
x_nb_frozen=0
x_nb_progressing_servicing=0
x_nb_suspended=0
x_nb_to_begin=0
x_nb_total=0
x_newline_convention=
x_next_xfer=0
x_org_alias=DENV03-client001
x_originator=DENV03-client001
x_padding=00
x_param1=
x_param2=
x_path_name=/server1_fs03/XFB/Gateway685/run_time/tmp/F0162455
x_permanent=N
x_prev_xfer=0
x_priority=1
x_proto_spec_str=
x_protocol=PHSE
x_purge_option=N
x_rcv_appli=
x_rcv_msg=
x_rcv_text=
x_rcv_user=
x_rec_count=27
x_rec_fmt=S
x_rec_len=32000
x_receipt_nack_msg=
x_receipt_reply_by_xfer=0
x_receipt_reply_to_xfer=0
x_receipt_request=
x_receipt_request_sync=N
x_receipt_request_to=
x_receipt_sent_mode=
x_receipt_subtype=
x_receipt_type=
x_remote_agent=DENV03-client001
x_reply_by_xfer=0
x_reply_to_xfer=0
x_request_method=
x_retry_count=0
x_retry_count_max=5
x_route_from_xfer=0
x_route_state=PROCESSING
x_route_to_xfer=0
x_sap=1764
x_select_req=0
x_sentinel_transfer_filter=ALL
x_sentinel_xferident=
x_sentinel_xferobjectname=XFBTransfer
x_sequence=124
x_site_user_param1=
x_site_user_param2=
x_smtp_bcc=
x_smtp_cc=
x_smtp_from=
x_smtp_subject=
x_smtp_to=
x_snd_appli=
x_snd_msg=
x_snd_text=
x_snd_user=
x_state=E
x_string_user_param1=
x_string_user_param2=
x_string_user_param3=
x_string_user_param4=
x_string_user_param5=
x_sys_dep=
x_text_file=N
x_tls_cipher_suite=
x_tls_client_auth=N
x_tls_server_auth=N
x_tls_sprof=
x_total_files=0
x_total_requests=0
x_tpm_dea_id=
x_trade_compress=N
x_trade_compress_algo=
x_trade_dest=
x_trade_dest_alias=
x_trade_encrypt=N
x_trade_encryption_algo=
x_trade_file_encoded=N
x_trade_format=
x_trade_key_encryption_algo=
x_trade_org=
x_trade_org_alias=
x_trade_receipt_content_type=
x_trade_receipt_message_id=
x_trade_receipt_mic=
x_trade_receipt_mic_algo=
x_trade_receipt_recipient=
x_trade_receipt_sign_algo=
x_trade_receipt_signature=
x_trade_remote_destination=N
x_trade_sign=N
x_trade_sign_algo=
x_trade_state=
x_truncating_allowed=N
x_type=TRANS
x_uniq_filename=N
x_unique_filename=N
x_unprocessed_dir_path=
x_unprocessed_file_component=
x_user_processed=N
x_user_state=
x_username=admin
x_x_bytes=3294
x_x_data_code=B
x_x_rec_fmt=V
x_x_rec_len=512
x_xfer_ident=2609595
x_xfer_rec_fmt=V
x_xfer_rec_len=512
x_xntf_filter=ALL
x_xntf_profile=
x_yday=326





Go to the top of the page
 
+Quote Post
Trommsdorf
post Nov 25 2008, 08:39 AM
Post #9


Visitor
*

Group: Members
Posts: 4
Joined: 11-November 08
From: Berlin
Member No.: 170


Hello rockstar,

I think your problem is not at the gateway, because of

cftutil.exe send type=file,fcode=binary,ftype=b,part=server1,idf=CIE_XGC_DEVL

Did you define at the CFT your nfname at the idf (send template file)?

When you want to get the original file name on your gateway you must define at the CFT that this file name is send.

So you have two possiblities

1. cftutil.exe send type=file,fcode=binary,ftype=b,part=server1,idf=CIE_XGC_DEVL, nfname=XXXX (XXX is the remote file name)

2. define in your send template nfname=&FROOT.&FSUF (then the original File name is send)

regards

Sven
Go to the top of the page
 
+Quote Post
jmmahieu
post Nov 25 2008, 01:33 PM
Post #10


Contributor
**

Group: Members
Posts: 14
Joined: 6-November 08
From: Puteaux
Member No.: 140


Hello,

Sure that x_file_label is the right variable but you have to put CFT in the send message field of the Gateway remote site which defines your CFT partner. Like this Gateway and CFT will exchange extra parameter which are not exchanged otherwise.

x_file_label is correspond to PI 37 in Pesit and it is the only PI define to exchange the original file name.

Regards


--------------------
JM MAHIEU
Go to the top of the page
 
+Quote Post
rockstar
post Nov 25 2008, 07:52 PM
Post #11


Contributor
**

Group: Members
Posts: 10
Joined: 17-November 08
Member No.: 189


QUOTE (jmmahieu @ Nov 25 2008, 08:33 AM) *
Like this Gateway and CFT will exchange extra parameter which are not exchanged otherwise.


I modified the value of "s_snd_msg" as suggested and I'm now getting this:

Receive message : CFT B=0,R=512,O=C,S=14,T=B,F=U,X= ,Y=S,I=K2512344,G=,H=,L=,M=,P=821,U=account1,W=,0=d:\prod\gpx\data\xgc.csv,J=2;0;0;1;21;2;24;11;4;36

"x_file_label" is still empty, but I don't mind. At least now I receive the initial filename. Thank you all for your help!
Go to the top of the page
 
+Quote Post

Reply to this topicNew Topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Skin designed by IPB Forum Skins