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:
/var/cache/
/var/lock/
/var/log/
/var/run/
/var/spool/
/var/tmp/
logs/
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.