Created
February 23, 2022 18:00
-
-
Save cuihaoleo/1c3560edab0ab60734736f03609de4b0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=Backup data using restic | |
After=network-online.target | |
Wants=network-online.target | |
[Service] | |
User=root | |
Group=root | |
EnvironmentFile=/etc/systemd/%N.env | |
Type=oneshot | |
ExecStart=/usr/bin/restic backup /home /etc /var --exclude-if-present=.nobackup --exclude-caches --exclude-file=/etc/restic-exclude | |
ExecStartPost=/usr/bin/restic forget --keep-last 3 --keep-daily 7 --keep-weekly 5 --prune |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=Run server backup daily | |
[Timer] | |
OnCalendar=daily | |
Persistent=true | |
[Install] | |
WantedBy=timers.target |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment