Page 1 of 1

Move Files from Host server source to Host server Target

Posted: Mon Apr 22, 2013 3:44 am
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

Posted: Mon Apr 22, 2013 7:00 am
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.

Posted: Mon Apr 22, 2013 4:19 pm
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.