[Techtalk] Re:Shell script not working for a remote ssh login

Lucky Lady needlesschatter at yahoo.com
Fri Mar 14 09:39:41 EST 2003


Hi to all and TGIF,

Thanks for the suggestion Jen. I also read Rick's
article decided to go with the following bash script:

#!/bin/bash

su - backup --command='/usr/bin/scp
support.mycompany.com:/home/backup/support.tar.gz
/home/backup/cur_support.tar.gz'

exit

This works fine as a cron job on my backup PC and the
tar (on my support PC) is created every week by
another cron job (on the support PC) with another bash
script. 

DaLy


-------------------------------------------------------
Date: Wed, 12 Mar 2003 17:35:58 -0800
From: jennyw <jennyw at dangerousideas.com>
To: Lucky Lady <needlesschatter at yahoo.com>
Cc: techtalk at linuxchix.org
Subject: Re: [Techtalk] Shell script not working for a
remote ssh login 
-
	manually entering commands work fine

Message: 1

You might consider as an alternative using rsync ...

rsync -v -a -e ssh user at host:/directory .

Would copy all your files to the current directory
over ssh.  Rsync has
the advantage of copying only changed files, which can
make things much
quicker.

Of course, you can get really fancy with rsync and
ssh.  Here's an 
article (although I haven't followed it I've heard
others have had luck 
with it): 

http://www.linuxmafia.com/~rick/linux-info/ssh-publickey-process

Jen


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


More information about the Techtalk mailing list