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

Bowen, Tricia tbowen at CapitalThinking.com
Wed Mar 12 17:42:53 EST 2003


Try using the full path to scp in your script, like /usr/local/bin/scp 
--Tricia

-----Original Message-----
From: Lucky Lady [mailto:needlesschatter at yahoo.com]
Sent: Wednesday, March 12, 2003 3:55 PM
To: techtalk at linuxchix.org
Subject: [Techtalk] Shell script not working for a remote ssh login -
manually enteringcommands work fine


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
_______________________________________________
Techtalk mailing list
Techtalk at linuxchix.org
http://mailman.linuxchix.org/mailman/listinfo/techtalk
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://linuxchix.org/pipermail/techtalk/attachments/20030312/854d95ae/attachment.xhtml


More information about the Techtalk mailing list