[Techtalk] Shell script not working for a remote ssh login - manually entering commands work fine

Lucky Lady needlesschatter at yahoo.com
Wed Mar 12 13:54:46 EST 2003


Hi,

I just set up a remote ssh logon without using a
password. All works fine. Basically, I want to be able
to use a shell script to copy a tarball from the
remote PC to my backup PC. When I enter these commands
in manually, everything works.

1. su backup 

2. scp
support.mycompany.com:/home/backup/support.tar.gz
/home/backup/cur_support.tar.gz

3. exit 

This takes a few minutes as the tarball is 12 mb.

However, when I put these commands in a shell script
and run it, the tarball is not copied and I remain on
the remote pc. Here is my shell script:

#!/bin/sh

su backup

scp support.mycompany.com:/home/backup/support.tar.gz
/home/backup/cur_support.tar.gz

exit

# End of script

What am I missing?

TIA

DaLy





__________________________________________________
Do you Yahoo!?
Yahoo! Web Hosting - establish your business online
http://webhosting.yahoo.com


More information about the Techtalk mailing list