Automate rsync w/ authentication

Bryan bryanvick at gmail.com
Mon Jul 13 10:52:51 EDT 2009


On Jul 10, 12:03 pm, mgi... at motorola.com (Gary Duzan) wrote:
> In article <3af970b1-b454-4d56-a33f-889ecfaca... at l28g2000vba.googlegroups.com>,
>
> Bryan  <bryanv... at gmail.com> wrote:
>
> >rsyncExec = '/usr/bin/ssh'
> >source = 'r... at 10.0.45.67:/home/bry/jquery.lookup'
> >dest = '/home/bry/tmp'
> >rshArg = '-e "/usr/bin/ssh -i /home/bry/keys/brybackup.key"'
> >args = [rsyncExec, '-a', '-v', '--dry-run', rshArg, source, dest]
>
>    I think you want -e and the ssh command to be separate args.
> Something like:
>
> rshArg = '/usr/bin/ssh -i /home/bry/keys/brybackup.key'
> args = [rsyncExec, '-a', '-v', '--dry-run', '-e', rshArg, source, dest]
>
> or:
>
> rshArgs = [ '-e', '/usr/bin/ssh -i /home/bry/keys/brybackup.key' ]
> args = [rsyncExec, '-a', '-v', '--dry-run'] +  rshArgs + [ source, dest]
>
>                                         Gary Duzan
>                                         Motorola H&NM

Separating the argument parts worked.  Strangely though, I don't need
to do that for arguments such as --files-from='/path/to/file'.  Also,
in this example code I had the rsync executable path pointing to the
ssh program, so no wonder I was getting the output of ssh!



More information about the Python-list mailing list