Add backup path in vars
This commit is contained in:
parent
198f7648d2
commit
46c3bd9258
@ -4,6 +4,7 @@
|
|||||||
vars:
|
vars:
|
||||||
borg.repo.path: /var/backup/backup.borg/
|
borg.repo.path: /var/backup/backup.borg/
|
||||||
borg.repo.encryption: none
|
borg.repo.encryption: none
|
||||||
|
borg.backup.paths: /etc/ /var/spool/ --exclude=*.log
|
||||||
tasks:
|
tasks:
|
||||||
- name: "Install borg backup"
|
- name: "Install borg backup"
|
||||||
apt:
|
apt:
|
||||||
|
@ -2,12 +2,10 @@
|
|||||||
|
|
||||||
# Borg repo location
|
# Borg repo location
|
||||||
REPOSITORY={{borg.repo.path}}
|
REPOSITORY={{borg.repo.path}}
|
||||||
# Example of remote repo
|
|
||||||
# REPOSITORY=ssh://backuper@192.168.1.100/{{borg.repo.path}}
|
|
||||||
|
|
||||||
echo "`date +[%F/%T]` Starting the backup"
|
echo "`date +[%F/%T]` Starting the backup"
|
||||||
# Create backup
|
# Create backup
|
||||||
borg create -v --compression lzma,6 --stats $REPOSITORY::$(date +%Y-%m-%d-%H:%M) /etc/ /var/spool/ --exclude=*.log
|
borg create -v --compression lzma,6 --stats $REPOSITORY::$(date +%Y-%m-%d-%H:%M) {{borg.backup.paths}}
|
||||||
# Clean old backups
|
# Clean old backups
|
||||||
borg prune -v $REPOSITORY --keep-daily=3 --keep-weekly=2 --keep-monthly=12
|
borg prune -v $REPOSITORY --keep-daily=3 --keep-weekly=2 --keep-monthly=12
|
||||||
echo "`date +[%F/%T]` Done!"
|
echo "`date +[%F/%T]` Done!"
|
||||||
|
Loading…
Reference in New Issue
Block a user