[sf-lug] question about using rsync and ssh in a script

John Magolske b79net at gmail.com
Fri Jul 9 16:45:48 PDT 2010


I put together a simple script to rsync a couple directories of files
from a local machine up to a server using rsync & ssh like so:

  #!/bin/sh
  rsync -av --delete -e ssh /path/to/site/ user at 123.456.78.900:dir/html
  rsync -av --delete -e ssh /path/to/files user at 123.456.78.900:dir

This ends up prompting me for the same password twice, and I'd like to
only have to input the password once. I suppose there are a variety
of solutions, but I'm not figuring it out as I sit here reading
though the rsync man page. I was wondering if someone with more
rsync/ssh/shell-scripting fu than I might suggest an elegant way to
accomplish this...

TIA for any suggestions.

John


-- 
John Magolske
http://B79.net/contact




More information about the sf-lug mailing list