I've severals VPS with Ubuntu 18.04 LTS.
One of these VPS is the backup master and launches rsnapshot to backup its own folders and pull the remote folders on the other VPSs.

These are the commands in the file rsnapshot.conf:

#server1 (backup server)
backup  /etc/   server1/
backup  /home/  server1/
backup  /opt/   server1/
backup  /root/  server1/
backup  /srv/   server1/
backup  /usr/local/ server1/
backup  /var/   server1/  
exclude /var/cache/
exclude /var/lock/
exclude /var/log/
exclude /var/run/
exclude /var/spool/
exclude /var/tmp/
exclude logs/

 #server2 (remote server)
backup  server2:/etc/   server2/    +rsync_long_args=--rsync-path=/usr/local/bin/rsync_wrapper.sh  
backup  server2:/home/  server2/    +rsync_long_args=--rsync-path=/usr/local/bin/rsync_wrapper.sh  
backup  server2:/opt/   server2/    +rsync_long_args=--rsync-path=/usr/local/bin/rsync_wrapper.sh  
backup  server2:/srv/   server2/    +rsync_long_args=--rsync-path=/usr/local/bin/rsync_wrapper.sh  
backup  server2:/usr/local/ server2/    +rsync_long_args=--rsync-path=/usr/local/bin/rsync_wrapper.sh  
backup  server2:/var/   server2/    +rsync_long_args=--rsync-path=/usr/local/bin/rsync_wrapper.sh,--exclude=/var/cache/,--exclude=/var/lock/,--exclude=/var/log/,--exclude=/var/spool/,--exclude=/var/tmp/

With rsnapshot configtest, the last row is reported as a configuration error.
My goal is to save the same folders as the main server and to exclude some of them under /var.

I have consulted the man and several pages online, but I cannot understand what the right syntax is for excluding multiple folders in a single backup row.

Thanks in advance for the help.

=== Update ===

I've changed the last command with:

backup  server1:/var/   server1/    +rsync_long_args=--rsync-path=/usr/local/bin/rsync_wrapper.sh,exclude_file=/etc/rsnapshot.exclude

The file rsnapshot.exclude contains:


Now the command is executed without errors, but for the server1 it has copied the whole /var directory, including the folders to be excluded. Instead nothing in /var for the others servers.

  • "All parameters in this file must be separated by tabs". Do you have maybe a space instead? Also I suggest you use exclude_file instead of multiple excludes. Jul 6 '19 at 19:07
  • Please, see my update Jul 7 '19 at 5:43

You have to separate the arguments to rsync with spaces, not commas. I.e., instead of this:


You should use:

+rsync_long_args=--rsync-path=/usr/local/bin/rsync_wrapper.sh exclude_file=/etc/rsnapshot.exclude

rsnapshot will pass the arguments verbatim to rsync. If you use commas, it will believe everything (--rsync-path=/usr/local/bin/rsync_wrapper.sh,exclude_file=/etc/rsnapshot.exclude) is a single one, and won't work. There should be errors in the log file for rsnapshot.

That was my experience, at least. I tried to add one more option to rsync_long_args and found rsnapshot ignored me. When I changed the comma for a space it started working. Please, try this and see if it works for you too.

  • There are some other errors Jul 7 '19 at 18:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.