tags:

views:

70

answers:

1

i would like to automate the rsync task as a cron job.. since it needs the passphrase i am not able to do the cronjob. i need to specify the passphrase along with the rsync command or i will store the passphrase in a file and i will read from it. my command will look like this..

rsync -aPe "ssh -i ' . $server->{'ssh_key'} . '" ' . $server_lock_dir;

so where do i put the password .. pls help

+3  A: 

You don't need to do that - just need to set up a pair of ssh keys and put the public key in the remote system's .ssh directory.

Then you just do this:

rsync -a -e ssh /local/path/ server:/remote/path/

There's a "how to" guide on setting up the keys here.

Paul R