Sftp ing the files and deleting files on remote server.

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

venkat_april
Participant
Posts: 26
Joined: Mon Jan 23, 2006 12:47 am

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

Post 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 {} \;
kollurianu
Premium Member
Premium Member
Posts: 614
Joined: Fri Feb 06, 2004 3:59 pm

Post 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.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply