Advertisement
Guest User

Untitled

a guest
Jun 24th, 2019
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. # Needs to be placed in ~/.config/systemd/user/
  2. [Unit]
  3. Description=Backup with restic before shutdown
  4. Before=poweroff.target halt.target
  5. After=networking.service
  6.  
  7. [Service]
  8. Type=oneshot
  9. ExecStart=/usr/bin/restic backup --verbose --one-file-system --tag systemd.shutdown $BACKUP_EXCLUDES $BACKUP_PATHS
  10. 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
  11. EnvironmentFile=%h/.config/restic-backup.conf
  12. RemainAfterExit=yes
  13.  
  14. [Install]
  15. WantedBy=poweroff.target halt.target
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement