Wrap backup script in systemd service and timer
This commit is contained in:
parent
cf23a37aa0
commit
b7183ceeae
3 changed files with 52 additions and 8 deletions
15
roles/backups/templates/borg_backup.service.j2
Normal file
15
roles/backups/templates/borg_backup.service.j2
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
[Unit]
|
||||
Description=BorgBase backup service
|
||||
Wants=network-online.target
|
||||
After=network-online.target
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
User=root
|
||||
Group=root
|
||||
ExecStart={{ backups_script_path }} {{ backups_configuration_path }}
|
||||
Environment="BORG_REPO={{ borg_base.repo_url }}"
|
||||
Environment="BORG_PASSPHRASE={{ borg_backup_password }}"
|
||||
|
||||
[Install]
|
||||
WantedBy=default.target
|
||||
Loading…
Add table
Add a link
Reference in a new issue