View previous topic :: View next topic
|
Author |
Message |
gautamc
New User
Joined: 15 Mar 2008 Posts: 3 Location: US
|
|
|
|
Hi,
I am trying to run a simple UNIX command after i successfully executed SFTP command as shown below.
-----------------------------------------
echo 'Step-1'
sftp -vvv -b path
exit
echo 'Step-2'
------------------------------------------
In above script it executes from the 1st 'echo' command till the 'exit' then comes out of the script. But my requirement is to also execute the 2nd 'echo' command. So is there a way to run further UNIX command after SFTP, even by calling another script to run further command is fine.
Thanks for your help.. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello gautamc and welcome to the forums,
You might:
- try moving "exit" onto the same line as "sftp"
- try using "bye" or "quit" instead of "exit" |
|
Back to top |
|
|
gautamc
New User
Joined: 15 Mar 2008 Posts: 3 Location: US
|
|
|
|
I checked them all, but none of the worked.
-exit in same line does not help, as by sftp you are just connecting to other server, but you need to execute 'mput' command to transfer the file.
- 'bye' & 'QUIT' command exits from UNIX session. But I want to execute UNIX command without logging out of session.
So let me know if it is possible to execute further or another script without logging.
Thanks for your help.. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
So let me know if it is possible to execute further or another script without logging. |
As i recall, our file transfers did not automagically log the user off of the system. . . It has been a while since i had a UNIX server to work with, so this is all from memory. . .
Have you done any research on sftp? I just found out (web search) that bye, quit, and exit all cause the connection to be terminated and the user logged off (if i read it correctly). For a test you might remove these.
Not in your original post, but later, you mention mput. I am not sure that sftp supports mput -ftp does, but maybe not sftp.
What is in your batch file ( -b path ) and what do you want -vvv to do? -v should specify "verbose", but i have no idea what -vvv is supposed to do. |
|
Back to top |
|
|
gautamc
New User
Joined: 15 Mar 2008 Posts: 3 Location: US
|
|
|
|
Well I am using SFTP for sometime now & I never had a requirement to execute UNIX commands after logging out of SFTP.
Well SFTP just logs into the other server, but in order to move the file we have to execute 'mput' & other command. & '-b' option excute the UNIX command in the script at location 'path' & -vvv is also for verbose. |
|
Back to top |
|
|
|