Bad option escaping in rsync handler
Backupninja 0.9.7-5 on Ubuntu 10.04 64 bits.
I'm using the following simple configuration in an .rsync target, for a local backup:
[general] log = /var/log/backup.log mountpoint = /mnt/Backup backupdir = System lockfile = /var/run/backup.lck days = 14 [source] from = local include = /etc include = /var
It fails with the following error message:
Debug: nice -n 0 /usr/bin/rsync -av --delete --recursive --numeric-ids //etc/ /mnt/Backup/System//etc/etc.0/ rsync: -av --delete --recursive --numeric-ids: unknown option rsync error: syntax or usage error (code 1) at main.c(1443) [client=3.0.7] Warning: Rsync error when trying to transfer /etc Warning: <<<< finished action /etc/backup.d/30.rsync: WARNING
Not actually a warning since the backup isn't done.
It seems that when passing the options to rsync the double quotes make it think that "-av --delete --recursive --numeric-ids" is actually one single option. Here is a simple diff that fixes the problem, by removing the quotes.
--- rsync.orig 2012-03-04 13:36:15.000000000 +0100 +++ rsync 2012-03-04 13:36:34.000000000 +0100 @@ -1061,8 +1061,8 @@ set_dest
info "Syncing $SECTION on $dest_path..."
- debug $nice
rsync "
{rsync_options[@]}" $filelist_flag $excludes $batch_option $orig $dest_path - $nice
rsync "
{rsync_options[@]}" $filelist_flag $excludes $batch_option $orig $dest_path >> $log
-
debug $nice $rsync ${rsync_options[@]} $filelist_flag $excludes $batch_option $orig $dest_path
-
$nice $rsync ${rsync_options[@]} $filelist_flag $excludes $batch_option $orig $dest_path >> $log
if [ "$?" != "0" ]; then warning "Rsync error when trying to transfer $SECTION"
Thanks for your work; HTH.
(from redmine: created on 2012-03-04, closed on 2012-03-04)