Rsnapshot configuration: spaces in config file

  • Hello all,


    How do I correctly specify additional rsync arguments with spaces in the rsnapshot.conf so that they are correctly forwarded to the rsync command ?


    In my setup, used to backup files from my desktop to the OMV server, I want to included a per-directory rsync filter file for a specific backup configuration, so the part in rsnapshot.conf looks:


    backup hal2000:/home home +rsync_long_args=--filter=": .rsync-filter"


    The problem is that rsnapshot removes the quotes and passes the filter argument unquoted to rsync, which obviously causes rsync to fail due to the space. I tried the following:

    * backup hal2000:/home home +rsync_long_args='--filter=": .rsync-filter"' - which fails because rsnapshot does not support nested quotes.

    * backup hal2000:/home home +rsync_long_args=--filter=:\ .rsync-filter - fails with "ERROR: /usr/bin/rsync syntax or usage error. Does this version of rsync support --link-dest?". However, if issuing a direct rsync command, escaping like this works.


    Any ideas ?

  • Wumpus

    Hat den Titel des Themas von „Rsnapshot configuration“ zu „Rsnapshot configuration: spaces in config file“ geändert.
  • Hi,

    Zitat

    The problem is that rsnapshot removes the quotes and passes the filter argument unquoted to rsync, which obviously causes rsync to fail due to the space.

    Sorry :huh:, I was wrong, I messed that up ?(.

    It seems that rsnapshot effectively escapes all white spaces before executing rsync; this means you just leave the rsnapshot.conf entry as above (or maybe even without the quotes, did not try). Then rsnapshot removes the quotes, but escapes the argument so that finally rsync executes as required.

    I was mislead because when executing rsnapshot -t -v the rsync command line is printed w/o quotes, but also non-escaped.


    Regards, Wumpus

  • Wumpus

    Hat das Label gelöst hinzugefügt.

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!