restic

Install

sudo apt install -y restic

Configure systemd

cat <<EOF> ~/.config/systemd/user/restic-backup.service
[Unit]
Description=Restic backup service
 
[Service]
Type=oneshot
Environment=BACKUP_PATHS="vault.pass vault-private.pass .gtkrc-2.0 .bashrc .icons .themes .thunderbird .config .ssh/config"
Environment=BACKUP_EXCLUDES="--exclude=Code --exclude=google-chrome --exclude=VirtualBox --exclude=ImapMail"
Environment=RETENTION_HOURS=8
Environment=RETENTION_DAYS=5
Environment=RETENTION_WEEKS=0
Environment=RETENTION_MONTHS=0
Environment=RETENTION_YEARS=0
Environment=RESTIC_REPOSITORY=%h/Backup
Environment=RESTIC_PASSWORD=sup3r_s3cr3t_r3p0_p4ssw0rd
ExecStart=restic backup --tag systemd.timer $BACKUP_EXCLUDES $BACKUP_PATHS
ExecStartPost=restic forget --tag systemd.timer --group-by "paths,tags" --prune --keep-hourly $RETENTION_HOURS --keep-daily $RETENTION_DAYS 
#--keep-weekly $RETENTION_WEEKS --keep-monthly $RETENTION_MONTHS --keep-yearly $RETENTION_YEARS
ExecStartPost=rsync -aHAXx --numeric-ids --delete --stats --info=progress2 --out-format="[%%t]:%%o:%%f:Last Modified %%M" --verbose -e "ssh -o Compression=no -x" "%h/Backup/" restic@BACKUP_SERVER_FQDN:/home/restic/HOSTNAME/
EOF
<code>
 
<strong>Links</strong>
https://www.geekbundle.org/backups-mit-restic/