2024-02-10 11:09:14 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
# Borg repo location
|
2024-02-10 11:25:20 +00:00
|
|
|
REPOSITORY={{borg_repo_path}}
|
2024-02-10 11:09:14 +00:00
|
|
|
|
|
|
|
echo "`date +[%F/%T]` Starting the backup"
|
|
|
|
# Create backup
|
2024-02-10 11:40:49 +00:00
|
|
|
borg create -v --compression lzma,6 --stats $REPOSITORY::$(date +%Y-%m-%d-%H:%M) {{borg_backup_paths}} {{borg_exclude_paths}}
|
2024-02-10 11:09:14 +00:00
|
|
|
# Clean old backups
|
|
|
|
borg prune -v $REPOSITORY --keep-daily=3 --keep-weekly=2 --keep-monthly=12
|
|
|
|
echo "`date +[%F/%T]` Done!"
|
|
|
|
|
|
|
|
exit
|