on 10-29-2008 3:27 AM
Hi All,
An empty .txt file has to be created in FTP location(FTP loc c:\xyz\Customer20082910.txt) only after the .dat file has been created(FTP loc c:\xyz\Customer20082910.dat)
Note:.dat has the actual data and .txt is an empty file and is created only after .dat is created
I know that .txt empty file can be created using the After Message Processing Command Line...
But confused which command to be given such that it will be created in the FTP location(c:\xyz\Customer20082910.txt)
Can any one please give the Linux command for it...
Regards,
Sridhar
Hey
OS commands triggered by File receiver communication don't run on FTP,they run on NFS.
If you want to handle this via File adapter,then use the "Use temporary file" option in the mode instead of OS scripts.
If you want to use a script then run the script via a scheduler on FTP itself,it will run Independent of XI adapter(wont be called from File receiver communication channel).
Thanx
Aamir
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Aamir,
You are right ...
I have already used Use Temporary file and the .dat file is created only after all the data has been transferred...
But still our client needs the .txt to be created once the .dat has been created...
So should i suggest the Client to create shell scripts at FTP location so that whenever .dat has been created an .txt has to be created...
Or is there any other way which i can handle...
Please suggest...
Regards,
Sridhar
>>So should i suggest the Client to create shell scripts at FTP location so that whenever .dat has been created an .txt has to be created...
Yes,this is the best approach.Do not connect to FTP server from XI machine and then run the script there,technically speaking its possible to do it but is always discouraged coz your script will reside on XI system but will run on FTP.Its the same way as an external system gets control of your PC and then run scripts on it remotely.I bet your client doesn't want this to happen to his system
Thanx
Aamir
Hi Aamir,
Thanks for the suggestion, I will ask my client to create a shell script at FTP server...
And one more question,
This is reverse side , now the .dat file is to be picked only if .txt exists at the FTP server (scenario File > XI>SAP) (earlier was SAP>XI>File)..
So please can you suggest for this also...
How can i check for the .txt and pick corresponding .dat file...
i had posted question long back
Regards,
Sridhar
Hi
As Amir suggested better approach is to create script at FTP server and execute.
You can do like this to connect to FTP in script
#!/bin/sh
HOST='ftp hostname'
USER='id'
PASSWD='yourpw'
FILE='file.txt'
ftp -n $HOST <<END_SCRIPT
quote USER $USER
quote PASS $PASSWD
put $FILE
quit
END_SCRIPT
exit 0
Thanks
Gaurav
>>now the .dat file is to be picked only if .txt exists at the FTP server
We had the exact same issue some time ago:)
This will be a very simple script too.ask the sender system to write the complete file in a .txt file itself(no need of both .dat and .txt at the same time).then in the end just rename this .txt file to .dat file and XI can pool for *.dat file.
I guess they are using .dat and .txt because they want to make sure that you don't pick up half written files.
Thanx
Aamir
Hi Aamir,
Thanks for your suggestion, and even i had seen your answers to my earlier thread on the same issue...
And i think the best solution is to go as you suggested..
and please can you tell what are the disadvantages in using shell script for FTP server and calling them from XI...
This i need to explain to the client ... please send your valuable suggestions...
Regards,
Sridhar
Hi Gaurav,
Thanks for your reply,
As per Aamir he suggesting to ask the client to create shell scripts at FTP server and it will be scheduled at FTP server only such that whenver .dat is created FTP itself creates .txt and XI will not call any shell script... but The FTP server takes care...
Aamir can you please confirm this if i understood was right
Regards,
Sridhar
Solved ,
As we suggested the client to write the scripts at their FTP server to create .dat files....
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey Sridhar
The OS Command for the file adapter only runs on the system in which the Adapter Framework is running.
Using Shell Script execution it is possible to put file on FTP. You can execute Shell Script in XI box. Inside your shell script you can FTP/S FTP program and connect to the remote server and create file.
If you are doing like this, then you need to dump the file into XI box using NFS protocol and then using shell script FTP the Files into FTP server.
Thanks
Gaurav
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
cat > filename.txt to create a file
cp firstfile secondfile copy file
mv thirdfile file3 renaming file
rm file3 removing file
Thanks
Gaurav
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
24 | |
12 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.