====== rsnapshot ======
A software to create backups on local or remote computers.
rsnapshot does backups with hardlinks. That saves a lot of space for incremental backup. The file system on the backup target has to support hard links (in Linux e.g. ext4, btrfs).
You should install rsnapshot on the server and do pull-style backups, although push-style backups are also possible.
===== config =====
#################################################
# rsnapshot.conf - rsnapshot configuration file #
#################################################
# #
# PLEASE BE AWARE OF THE FOLLOWING RULES: #
# #
# This file requires tabs between elements #
# #
# Directories require a trailing slash: #
# right: /home/ #
# wrong: /home #
# #
#################################################
config_version 1.2
snapshot_root /media/170a2bcd-d9b3-4d95-a5b2-4293ca53547c/Backups/
#no_create_root 1
cmd_cp /bin/cp
cmd_rm /bin/rm
cmd_rsync /usr/bin/rsync
#cmd_ssh /usr/bin/ssh
cmd_logger /usr/bin/logger
#cmd_du /usr/bin/du
#cmd_rsnapshot_diff /usr/bin/rsnapshot-diff
verbose 3
loglevel 2
logfile /var/log/rsnapshot.log
lockfile /var/run/rsnapshot.pid
#include_file /path/to/include/file
#exclude_file /path/to/exclude/file
#link_dest 0
#sync_first 0
#########################################
# BACKUP INTERVALS #
# Must be unique and in ascending order #
# i.e. hourly, daily, weekly, etc. #
#########################################
retain daily 7
retain weekly 4
retain monthly 24
###############################
### BACKUP POINTS / SCRIPTS ###
###############################
# LOCALHOST
backup /etc/ localhost/
backup /mnt/data/Management/ localhost/
backup /mnt/data/Team/ localhost/
### rsnapshot
0 1 * * * rsnapshot daily
0 3 * * 7 rsnapshot weekly
0 5 * * 7 run-if-today L && rsnapshot monthly
===== Backups with btrfs snapshots =====
#!/bin/sh
# Arg 1: -al
# Arg 2: /testbtrfs/backups/hourly.0
# Arg 3: /testbtrfs/backups/hourly.1
btrfs subvolume snapshot $2 $3
#!/bin/sh
# Arg 1: -rf
# Arg 2: /testbtrfs/backups/hourly.4/
# echo 1: $1 2: $@
# Try to delete the given path with btrfs subvolume delete first
# if this fails fall back to normal rm
if [ "$1" = "-rf" -a "$3" = "" ]; then
# "trying to delete with btrfs"
btrfs subvolume delete $2
error=$?
if [ $error -eq 13 ]; then
# EC 13 => The directory specified is no subvolume
rm $@
elif [ $error -ne 0 ]; then
echo Error while deleting with btrfs $?
fi
else
rm $@
fi
You have to configure the commands ''cmd_cp'' and ''cmd_rm'' in the ''rsnapshot.conf'' accordingly.
===== Databases =====
You should use [[backupninja]] for that.
===== Cloud =====
You can use [[rclone]] to copy files to the cloud.