Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Needs to be placed in ~/.config/systemd/user/
- [Unit]
- Description=Backup with restic before shutdown
- Before=poweroff.target halt.target
- After=networking.service
- [Service]
- Type=oneshot
- ExecStart=/usr/bin/restic backup --verbose --one-file-system --tag systemd.shutdown $BACKUP_EXCLUDES $BACKUP_PATHS
- ExecStartPost=/usr/bin/restic forget --verbose --tag systemd.shutdown --group-by paths,tags --keep-daily $RETENTION_DAYS --keep-weekly $RETENTION_WEEKS --keep-monthly $RETENTION_MONTHS --keep-yearly $RETENTION_YEARS
- EnvironmentFile=%h/.config/restic-backup.conf
- RemainAfterExit=yes
- [Install]
- WantedBy=poweroff.target halt.target
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement