Move Files from Host server source to Host server Target

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

Post Reply
amar.v023
Participant
Posts: 17
Joined: Thu Nov 19, 2009 12:55 am
Location: Hyderabad

Move Files from Host server source to Host server Target

Post by amar.v023 »

Hi All,

Is it possbile to move files from Host server source to Host server target in datastage execute command stage or before or after subroutine.

i am trying in my project but no luck. below is the code.

mv source server path/*.txt Target server path | sftp -o StrictHostKeyChecking=no User@server.intra

sftp -o StrictHostKeyChecking=no User@server.intra | mv source server path/*.txt Target server path
Amar
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Why are you piping "mv" and "sftp" together? The former won't move anything between servers and the latter needs more information to work. Use "mv" if you just need to move it to a new directory on the same server, use "sftp" to move it to another server.
-craig

"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Do some study about UNIX pipelining. You don't want the | operator here. As Craig notes, you may not need any operator. But, if you do want to pipeline two commands other operators exist, including ; && ||

Or you could use a DataStage job (not sequence) using an FTP stage.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply