[EMAIL PROTECTED] wrote:
> On Fri, May 30, 2008 at 12:42:48PM -0700, N?stor wrote:
>> When running the rsync command to copy files from one host to another how do
>> I pass teh password?
>>
>> This is my command:
>> rsync -avz host1:/home/www/ /home/www
>>
>> It always as for the password and I want to set it up to run as a cron job.
>
> You really want to learn about ssh-agent. Then perhaps set up a password less
> RSA for root.
We have hundreds of tunnels coming back to servers at work run by cron. The
general format is
SSH_CMD="ssh -xe none -o UserKnownHostsFile=$SSH_HOSTS -o IdentityFile=$SSH_ID
-o PasswordAuthentication=no"
different jobs have different users and different keys. Keys are stored in a
default location on the remote servers.
For rsync you could do rsync -e $SSH_CMD file_here
[EMAIL PROTECTED]:/directory/to/put/files/
In fact we have scripts that do this exactly for backups.
--
Neil Schneider pacneil_at_linuxgeek_dot_net
http://www.paccomp.com
Key fingerprint = 67F0 E493 FCC0 0A8C 769B 8209 32D7 1DB1 8460 C47D
"Work to eat, eat to live, live to bike, bike to work." -- Naomi Bloom
--
[email protected]
http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-list