Renaming a file using sftp

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

Post Reply
akonda
Participant
Posts: 97
Joined: Wed Feb 28, 2007 6:15 am

Renaming a file using sftp

Post 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
lstsaur
Participant
Posts: 1139
Joined: Thu Oct 21, 2004 9:59 pm

Post 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.
akonda
Participant
Posts: 97
Joined: Wed Feb 28, 2007 6:15 am

Post 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 ???
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
akonda
Participant
Posts: 97
Joined: Wed Feb 28, 2007 6:15 am

Post by akonda »

Resolved with "Open command" option in SFTP stage
arun
Post Reply