apt-get install -y rsnapshot mv /etc/rsnapshot.conf /etc/rsnapshot.conf.org cat <<EOF> /etc/rsnapshot.conf config_version 1.2 snapshot_root /media/backup/ logfile /var/log/rsnapshot.log verbose 3 loglevel 3 cmd_preexec /bin/mount /media/backup cmd_postexec /bin/umount /media/backup #backup_script /usr/local/bin/backup_mysql.sh localhost/mysql/ cmd_rsync /usr/bin/rsync rsync_long_args --delete --numeric-ids --relative --delete-excluded --copy-links cmd_ssh /usr/bin/ssh ssh_args -F /home/foo/.ssh/config -i /home/foo/.ssh/id_rsa interval daily 7 interval weekly 3 interval monthly 1 #exclude dev/* exclude lost+found/* exclude mnt/* exclude proc/* exclude run/* exclude sys/* exclude tmp/* include_file ~/etc/backup-server-include.txt exclude_file ~/etc/backup-server-exclude.txt # backup remote server backup root@www.example.com:/ srv/ +rsync_long_args=--exclude=export/* --exclude=media/*/.Trash* --exclude=video/* # backup local server backup / www.example.com/ +rsync_long_args=--exclude=mnt/* --exclude=media/* --exclude=var/lib/lxc/* --exclude=var/lib/lxcfs/* # backup LXC containers backup /var/lib/lxc www.example.com/ EOF # backup-server-exclude.txt /* /var/* /var/snap/* /var/snap/lxd/* /var/snap/lxd/common/* /var/snap/lxd/common/lxd/* /var/snap/lxd/common/lxd/database # rsnapshot/backup-server-include.txt /etc /var /var/snap /var/snap/lxd /var/snap/lxd/common /var/snap/lxd/common/lxd /var/snap/lxd/common/lxd/database rsnapshot -c /etc/rsnapshot.conf daily
Check configuration
rsnapshot configtest
Desktop starter
cat << EOF | sudo tee /usr/share/applications/rsnapshot.desktop [Desktop Entry] Name=Backup Exec=rsnapshot daily Icon=org.gnome.DejaDup Type=Application Terminal=true Categories=Utility;Archiving;GNOME;GTK;X-GNOME-Utilities; EOF
Links
https://wiki.archlinux.de/title/Rsnapshot
http://www.rsnapshot.org/howto/1.2/rsnapshot-HOWTO.en.html
http://wiki.ubuntuusers.de/rsnapshot