on 03-12-2014 7:22 AM
Hi All,
We have a requirement where we have File(NFS) to SFTP (username-Password authentication) scenario which will run once a day.
Client wants us to place file on target SFTP server with timestamp which is no issue.
The thing he wants SAP PI to do is to overwrite or we can say delete this file from target SFTP server before placing similar new file on next day.
So basically everyday before placing file on SFTP server I have to delete previous similar files present on target SFTP server.
I would like to avoid creating another configuration scenario for this requirement.
Though not sure but I think we can achieve this through some kind of script (.bat, powershell script) which can be placed on some AL11 path and then can be run in OS command line under processing tab in sender channel in "before processing" mode to check presence of file and deletion of same from SFTP server.
As I am new to scripts, will be thankful if someone can post sample script to "access and delete file from SFTP server" from a particular directory.
Let me know if you have solution to achieve same.
FYI: Our SAP PI server is a Windows server.
Regards
Saurabh
Hi Saurabh -
What kind of script you are looking for? Java? Perl? and i think you need custom libraries to work with SFTP.
Instead of executing the script from OS level, i would prefer a pass through interface which will pick the files from SFTP and place it somewhere else(archive directory)... You can even schedule this channel to run once in a day to delete the files.
Incase you still looking from some script.. i worked zehon and jcraft libraries and you can find some sample's here..
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Saurabh,
try using del *.* in (Run Operating System Command Before processing message ) SFTP Channel Properties and see.
Otheriwise try rm *.* as well
Thanks
Arun
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
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.