Plan borg: improved script.

This commit is contained in:
Christian P. MOMON 2023-02-08 13:08:40 +01:00
parent a81dd6f29c
commit 2d6daa50f5
1 changed files with 8 additions and 1 deletions

View File

@ -6,7 +6,14 @@ echo "==========================================================================
START_TIME=$(date +"%s") START_TIME=$(date +"%s")
START_SIZE=$(du -s /var/backups/borg/ | awk '{ print $1 }') START_SIZE=$(du -s /var/backups/borg/ | awk '{ print $1 }')
borgmatic prune --stats --files --verbosity 1 #borgmatic prune --stats --files --verbosity 1
# Only last borgmatic version has the compact command.
cd /var/backups/borg/
for REPO in $( ls -d *.repo ); do
echo "Compact $REPO"
borg compact "$REPO"
done
echo "=====" echo "====="
DURATION=$(($(date +"%s")-$START_TIME)) DURATION=$(($(date +"%s")-$START_TIME))