22 lines
540 B
SYSTEMD
22 lines
540 B
SYSTEMD
|
;ref: https://fedoramagazine.org/automate-backups-with-restic-and-systemd/
|
||
|
|
||
|
[Unit]
|
||
|
Description=Restic backup service
|
||
|
|
||
|
[Service]
|
||
|
Type=oneshot
|
||
|
ExecStart=restic backup \
|
||
|
--verbose \
|
||
|
--one-file-system \
|
||
|
--tag systemd.timer \
|
||
|
$BACKUP_EXCLUDES $BACKUP_PATHS
|
||
|
ExecStartPost=restic forget \
|
||
|
--verbose \
|
||
|
--tag systemd.timer \
|
||
|
--group-by "paths,tags" \
|
||
|
--keep-daily $RETENTION_DAYS \
|
||
|
--keep-weekly $RETENTION_WEEKS \
|
||
|
--keep-monthly $RETENTION_MONTHS \
|
||
|
--keep-yearly $RETENTION_YEARS
|
||
|
EnvironmentFile=%h/.config/restic/othalan.env
|