add backup service
This commit is contained in:
parent
4946f503a2
commit
72240e1382
6 changed files with 57 additions and 2 deletions
6
roles/borg/templates/backup.service.j2
Normal file
6
roles/borg/templates/backup.service.j2
Normal file
|
@ -0,0 +1,6 @@
|
|||
[Unit]
|
||||
Description=Backup data using borgmatic
|
||||
|
||||
[Service]
|
||||
ExecStart=/usr/bin/borgmatic --config /root/backup.yml
|
||||
Type=oneshot
|
14
roles/borg/templates/backup.yml.j2
Normal file
14
roles/borg/templates/backup.yml.j2
Normal file
|
@ -0,0 +1,14 @@
|
|||
location:
|
||||
source_directories:
|
||||
- /mnt/atlas
|
||||
repositories:
|
||||
- {{ backup_location }}
|
||||
retention:
|
||||
keep_daily: 7
|
||||
keep_weekly: 4
|
||||
keep_monthly: 6
|
||||
hooks:
|
||||
before_everything:
|
||||
- echo down | ssh backup-control@atlas.lan
|
||||
after_everything:
|
||||
- echo up | ssh backup-control@atlas.lan
|
Reference in a new issue