Ansible/templates/borgbackup.j2

14 lines
416 B
Plaintext
Raw Permalink Normal View History

#!/bin/bash
# Borg repo location
2024-02-12 18:48:45 +00:00
REPOSITORY={{ borg_repo_path }}
echo "`date +[%F/%T]` Starting the backup"
# Create backup
2024-02-12 18:48:45 +00:00
borg create -v --compression {{ borg_backup_compression }} --stats $REPOSITORY::{{ borg_backup_name_format }} {{ borg_backup_paths }} {{ borg_exclude_paths }}
# Clean old backups
borg prune -v $REPOSITORY --keep-daily=3 --keep-weekly=2 --keep-monthly=12
echo "`date +[%F/%T]` Done!"
exit