Since few weeks I use restic as my backup tool. I made the switch from rdiff-backup due to its slow speed and frequent erorrs. Advantages of restic is its support for different backends (ssh, s3, rest server, etc), encryption and deduplication.

To simplify my entire backup process, I choose to use the autorestic. With this tool you can configure restic using a YAML file, which is a lot easier than having to remember all the CLI options each time. Additionally, you cna configure hooks, before for actions like creating database before backup, or success/failure for sending notifications. Also it is possible to make backup with the same options to multiple backends. I’m using sftp backup and backblaze b2 (it looks like they are the cheapest s3-compatible option, and I love their disk reliability reports).

As a bonus - I made a small improvement for autorestic as newer version of restic broke the summary of backup. Merged PR for interested here.

Here is how I configured autorestic with systemd-timers.

backup.service

1
2
3
4
5
6
7
8
[Unit]
Description=restic backup work
RefuseManualStart=no
RefuseManualStop=yes

[Service]
Type=oneshot
ExecStart=autorestic --ci cron

backup.timer (for servers I use daily, for laptop hourly schedule)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
[Unit]
Description=restic backup work
RefuseManualStart=no
RefuseManualStop=no

[Timer]
Persistent=false
OnCalendar=hourly
RandomizedDelaySec=300
Unit=backup.service

[Install]
WantedBy=default.target