I am trying to run a shell (sh) script for backups, using rdiff-backup. The lines of interest are:
cmd="${prog} -v5 --print-statistics --include-globbing-filelist ${inclist} \
--exclude ** ${src} ${dest}"
echo "${cmd}"
$cmd
It echoes the correct command to me, but chokes on the command itself:
rdiff-backup -v5 --print-statistics --include-globbing-filelist /etc/backup/include-list --exclude ** / /backup/all
Using rdiff-backup version 1.2.8
Fatal Error: Switches missing or wrong number of arguments
See the rdiff-backup manual page for more information.
Running the command directly does work (using '**'
instead of **
). Note that I've tried using '**'
in the command string, but it's expanded wrong and gives an error like
Fatal Error: Fatal Error: The file specification
''**'
cannot match any files in the base directory
'/'
...
But I assume this is still an expansion issue, so maybe that's wrong. I am very confused at the moment, and would appreciate some help.
set -xv
to print out the command as debugging help. Maybe it will help.