On Thu 20 Oct 2016, Samuel Williams wrote: > > I'm using Ruby's Shellwords module, which generates a string from an > array, suitable for shell evaluation. > > Ruby's implementation prefers escaping whitespace with a backslash > rather than quotes. However, this appears to cause some kind of issue > in Rsync when it computes argv from -e option. > > Here is an example command generated by some Ruby code: > > rsync --archive --stats -e ssh\ -l\ backup\ -i\ /etc/synco/id_rsa\ -o\ > ConnectTimeout\\\=60\ -o\ BatchMode\\\=yes --link-dest > ../../latest/etc/ /etc/ > example.backup.server.com:/tank/backup/servers/blah/latest.snapshot/etc/
There's no reason to escape an "=" sign in the above command. Try: rsync --archive --stats -e ssh\ -l\ backup\ -i\ /etc/synco/id_rsa\ -o\ ConnectTimeout=60\ -o\ BatchMode=yes --link-dest ../../latest/etc/ /etc/ example.backup.server.com:/tank/backup/servers/blah/latest.snapshot/etc/ Or even: rsync --archive --stats -e ssh\ -i\ /etc/synco/id_rsa\ -o\ ConnectTimeout=60\ -o\ BatchMode=yes --link-dest ../../latest/etc/ /etc/ bac...@example.backup.server.com:/tank/backup/servers/blah/latest.snapshot/etc/ I'd probably create an entry for this host in ~/.ssh/config : Host example.backup.server.com User backup IdentityFile /etc/synco/id_rsa ConnectTimeout 60 BatchMode=yes and then just use: rsync --archive --stats --link-dest ../../latest/etc/ /etc/ example.backup.server.com:/tank/backup/servers/blah/latest.snapshot/etc/ If you're dynamically doing this, you can pass a config file with -F. Paul -- Please use reply-all for most replies to avoid omitting the mailing list. To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html