Restic backups

created: Mon, 29 Jul 2024 15:09:34 GMT, modified: Sun, 05 Jan 2025 15:37:12 GMT

How to set up backups with restic and rclone as a remote server.

I have Synology NAS and Mac with disabled Time Machine, because of the corporate security settings, so let's set it up differently. Let's assume we have root access to NAS, and we know NAS IP ($NAS_IP) address.

A simple, cross-platform restic backup GUI for browsing and restoring restic repositories.

Install rclone on NAS

curl https://rclone.org/install.sh | sudo bash

Create restic volume, say, /volume1/shared/restic, and then create a systemd start up file:

cat <<EOT > /etc/systemd/system/rclone.service
[Unit]
Description=Run rclone at startup
After=network.target

[Service]
Type=simple
ExecStart=/bin/rclone serve restic /volume1/shared/restic --addr :9090
Restart=on-failure

[Install]
WantedBy=multi-user.target
EOT
# start rclone service
systemctl start rclone

# check rclone service is running
systemctl status rclone

Create restic backup

# configure restic by setting up env variables
export RESTIC_REPOSITORY=rest:http://$NAS_IP:9090

# initialise repository
restic init

# backup home
restic backup ~

Final words

Now, if we have Tailscale installed both on NAS and laptop, we have now a complete and secure backup solution.