Page 2 of 2

Re: Sftp ing the files and deleting files on remote server.

Posted: Mon Nov 29, 2010 3:23 am
by venkat_april
kollurianu wrote:Hi all ,

After SFTP'ing the source files successfully to the local server , how to delete files from the remote server ? Any inputs greatly appreciated.

Thanks in advance.
rsh -l USER <SERVER> find <TOP LEVEL DIR> -atime <2years> -exec rm -r {} \;

Posted: Mon Nov 29, 2010 12:46 pm
by kollurianu
ArndW wrote:You will need to talk with your UNIX administrator. It seems that either "rsh" is not installed or not in your path, likewise will most likely be the case for "ssh" as well. Once you sort out getting this command working (with or without adding userid/password) then you can implement it into DataStage.
Thanks for your response , Could you please send me exact syntax to be used in command stage (in a job sequencer)?

Any inputs greatly appreciated.

Posted: Mon Nov 29, 2010 12:59 pm
by chulett
As noted, talk to your UNIX Admins. Once they help you get it working from the command line outside of DataStage, you'll know what the exact syntax is you'll need for the Sequence job.