restic
This commit is contained in:
12
restic/files/restic_backup.sh.jinja
Normal file
12
restic/files/restic_backup.sh.jinja
Normal file
@@ -0,0 +1,12 @@
|
||||
#!/bin/sh
|
||||
export HOME=/root
|
||||
export RESTIC_PASSWORD={{ salt.pillar.get('restic:pass') }}
|
||||
export RESTIC_REPOSITORY={{ salt.pillar.get('restic:repo') }}
|
||||
restic backup --tag files {{ salt.pillar.get('restic:files') }}
|
||||
{% if salt.pillar.get('restic:mysql', False) -%}
|
||||
mysqldump --all-databases | restic backup --stdin --stdin-filename /all_databases.sql --tag mysql
|
||||
{% endif -%}
|
||||
restic forget --keep-last 4 --tag mysql --prune
|
||||
{% if salt.pillar.get('restic:mysql', False) -%}
|
||||
restic forget --keep-last 4 --tag files --prune
|
||||
{% endif -%}
|
||||
Reference in New Issue
Block a user