restic.sh
#!/bin/bash
timeout 30 mount /home/backup/ && time autorestic --config /home/changeme/.autorestic.yml backup -a ; umount /home/backup
restic.service
[Unit]
Description="Restic script"
[Service]
ExecStart=/bin/bash -c "/home/changeme/restic.sh"
restic.timer
[Unit]
Description="Run restic.service 5min after boot and every 24 hours relative to activation time"
[Timer]
OnBootSec=5min
OnUnitActiveSec=24h
OnCalendar=Mon..Fri *-*-* 10:00:*
Unit=restic.service
[Install]
WantedBy=multi-user.target
/etc/fstab
storage.ip.address:/home/changeme/backup /home/backup nfs4 noauto,rw,hard,intr,rsize=8192,wsize=8192,timeo=14 0 0
~/.autorestic.yml
version: 2
locations:
home:
from: /home/changeme/
to: remote
options:
backup:
exclude:
- 'Dropbox/*'
- 'Dropbox*/*'
- '.cache'
- '.*CacheStorage.*'
- '.*CachedData.*'
- '.*Cache.*'
- '.var/app'
- '.cargo'
- '.ssh'
- '.rustup'
exclude-file: /home/changeme/.gitignore
backends:
remote:
type: local
path: "/home/backup/"
key: "changeme"