# - bof - # :a # - - # # - Install rsnapshot - # sudo apt install rsnapshot rsync -y; :b # - - # # - Create backup folder - # sudo mkdir -p /home/Data/Images/Backup/uServer/rSnapShot; :c # - - # # - Create include/exclude files - # sudo touch /home/Data/Images/Backup/uServer/rSnapShot/include.txt; sudo touch /home/Data/Images/Backup/uServer/rSnapShot/exclude.txt; sudo chmod 775 /home/Data/Images/Backup/uServer/rSnapShot/include.txt; sudo chmod 775 /home/Data/Images/Backup/uServer/rSnapShot/exclude.txt; :c.1 # - - # # - Content include/exclude files - # /dev /home/Data/Images/Backup /home/*/.cache /home/*/.gvfs /home/*/.tmp /home/*/.local/share/Trash /home/*/lost+found /media /mnt /proc /run /swap.img /sys /tmp /var/cache/apt/archives :d # - - # # - Edit rsnapshot.conf - # sudo vim /etc/rsnapshot.conf; # - - # # - Very important - # # - User only tab for spacing - # # - - # # - Backup folder - # #snapshot_root /var/cache/rsnapshot/ snapshot_root /home/Data/Images/Backup/uServer/rSnapShot/ # - - # # - Enable ssh - # #cmd_ssh /usr/bin/ssh cmd_ssh /usr/bin/ssh # - - # # - Enable du (check size of backup) - # #cmd_du /usr/bin/du cmd_du /usr/bin/du # - - # # - enable cmd_rsnapshot_diff - # #cmd_rsnapshot_diff /usr/bin/rsnapshot-diff cmd_rsnapshot_diff /usr/bin/rsnapshot-diff ######################################### # BACKUP LEVELS / INTERVALS # # Must be unique and in ascending order # # e.g. alpha, beta, gamma, etc. # ######################################### #retain alpha 24 #retain beta 7 retain gamma 4 retain delta 12 # - - # # - High log - # # Verbose level, 1 through 5. # 1 Quiet Print fatal errors only # 2 Default Print errors and warnings only # 3 Verbose Show equivalent shell commands being executed # 4 Extra Verbose Show extra verbose information # 5 Debug mode Everything # #verbose 2 verbose 5 # Same as "verbose" above, but controls the amount of data sent to the # logfile, if one is being used. The default is 3. # If you want the rsync output, you have to set it to 4 # #loglevel 3 loglevel 4 # - - # # - Enable log - # #logfile /var/log/rsnapshot.log logfile /var/log/rsnapshot.log # - - # # - Include/Exclude - # #include_file /path/to/exclude/file #exclude_file /path/to/exclude/file #include_file /home/Data/Images/Backup/uServer/rSnapShot/include.txt exclude_file /home/Data/Images/Backup/uServer/rSnapShot/exclude.txt Back up This is the section where you tell rsnapshot which files you actually want to back up. You put a backup parameter first, followed by the full path to the directory or network path you are backing up. The third column is the relative path you want to back up to inside the snapshot root. /etc/rsnapshot.conf ############################### ### BACKUP POINTS / SCRIPTS ### ############################### # LOCALHOST backup / uServer/ backup /home/ uServerHome/ backup /home/ localhost/ backup - Backup parameter /home/ - Directory you want to backup localhost/ - Folder where you will backup -> into rSnapShot-root snapshot_root -> /home/Data/Images/Backup/uServer/rSnapShot/ backup into -> /home/Data/Images/Backup/uServer/rSnapShot/localhost/ backup into -> /home/Data/Images/Backup/uServer/rSnapShot/uServerHome/ In this example, backup tells us it's a backup point. /home/ is the full path to the directory we want to take snapshots of, and localhost/ is a directory inside the snapshot_root we are going to put them in. Using the word localhost as the destination directory is just a convention. You might also choose to use the server's fully qualified domain name instead of localhost. If you are taking snapshots of several machines on one dedicated backup server, it's a good idea to use their various hostnames as directories to keep track of which files came from which server. Remote Systems In addition to full paths on the local filesystem, you can also backup remote systems using rsync over ssh. If you have ssh installed and enabled - via the cmd_ssh parameter - you can specify a path like: /etc/rsnapshot.conf ############################### ### BACKUP POINTS / SCRIPTS ### ############################### # example.com backup root@example.com:/etc/ example.com/ :e # - - # # - Test rsnapshot.conf - # sudo rsnapshot -t gamma; rsnapshot -t gamma; :f # - - # # - Execute rsnapshot.conf - # sudo rsnapshot gamma; rsnapshot gamma; :g # - - # # - exclude - # /dev /home/Data/Images/Backup /home/*/.cache /home/*/.gvfs /home/*/.tmp /home/*/.local/share/Trash /home/*/lost+found /media /mnt /proc /run /swap.img /sys /tmp /var/cache/apt/archives # - eof - #