Page 1 of 1

Renaming a file using sftp

Posted: Wed Oct 10, 2012 1:10 pm
by akonda
Guys

I need to connect to remote server using Sftp and rename a file. I used below command in executive command activity stage. but not working. If I execute below commands separately in putty its working fine. Any thoughts on why it is not working ? or is there any other way of doing ?

I can only do sftp to remote server not ssh or anything like that.

Command:
sftp userid@hostname; rename /home/File_1.txt /home/act/File_2.txt

Thanks

Posted: Wed Oct 10, 2012 2:40 pm
by lstsaur
What's the error message? Couldn't connect to remote server? Or couldn't rename the file? What you mean by not ssh; Putty is using the SSH Proctol on port 22. Try to use sftp stage.

Posted: Wed Oct 10, 2012 3:24 pm
by akonda
I m able to connect to remote server.
but not able to rename the file.

error:
Reply=127
Output from command ====>
SH: rename: 0403-006 Execute permission denied.

But I its working thru patty.

Does the sftp stage supports to rename the file ???

Posted: Wed Oct 10, 2012 3:33 pm
by ray.wurlod
Under what user name does the DataStage job run (that is, how are your Engine credentials set)? Does THIS user have execute permission to the rename script?

Posted: Wed Oct 10, 2012 4:44 pm
by akonda
Resolved with "Open command" option in SFTP stage