Fix var names
This commit is contained in:
parent
46c3bd9258
commit
ae692c8071
@ -2,9 +2,9 @@
|
|||||||
- hosts: all
|
- hosts: all
|
||||||
become: yes
|
become: yes
|
||||||
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
|
borg_backup_paths: "/etc/ /var/spool/ --exclude=*.log"
|
||||||
tasks:
|
tasks:
|
||||||
- name: "Install borg backup"
|
- name: "Install borg backup"
|
||||||
apt:
|
apt:
|
||||||
@ -12,9 +12,9 @@
|
|||||||
state: latest
|
state: latest
|
||||||
|
|
||||||
- name: "Create backup repository"
|
- name: "Create backup repository"
|
||||||
ansible.builtin.command: borg init -e {{borg.repo.encryption}} {{borg.repo.path}}
|
ansible.builtin.command: borg init -e {{borg_repo_encryption}} {{borg_repo_path}}
|
||||||
args:
|
args:
|
||||||
creates: {{borg.repo.path}}
|
creates: {borg_repo_path}
|
||||||
|
|
||||||
- name: "Configure backup script"
|
- name: "Configure backup script"
|
||||||
ansible.builtin.copy:
|
ansible.builtin.copy:
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Borg repo location
|
# Borg repo location
|
||||||
REPOSITORY={{borg.repo.path}}
|
REPOSITORY={{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) {{borg.backup.paths}}
|
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