How to do two or more rsyncs with one password?

Brian Cluff brian at snaptek.com
Sun Aug 15 13:47:01 MST 2010


My first thought is, why aren't you doing it with just one rsync call like:

rsync -avHp --progress subdir1 subdir2 subdir3 
webhost at box000.bluehost.com:www/

If it's because your example doesn't directly reflect your situation, as 
in your are needing to copy into several different destination 
directories, you will just need to setup a shared key for ssh and copy 
the public key over to the destinations authorized_keys file.  Once you 
have done that, you can copy over to the destination without any 
passwords at all if you want.

Brian Cluff

On 08/15/2010 01:23 PM, joe at actionline.com wrote:
>
> How can one do two or more rsyncs with entering the password just once?
>
> I've set up a script that I named copy2blue to copy three specified
> subdirectories to my web hosted space, and it works fine, except it
> asks me to enter the password for each 'rsync' command.
>
> How can I modify this so it will only ask for the password once?
>
> cd /dir/subdir1
> rsync -avHp --progress subdir1 webhost at box000.bluehost.com:www/subdir1/
>
> cd /dir/subdir2
> rsync -avHp --progress subdir2 webhost at box000.bluehost.com:www/subdir2/
>
> cd /dir/subdir3
> rsync -avHp --progress subdir3 webhost at box000.bluehost.com:www/subdir3/


More information about the PLUG-discuss mailing list