Plan borg: improved script.

This commit is contained in:
Christian P. MOMON 2023-01-26 15:45:10 +01:00
parent ef467fee0a
commit 30b4a05b8d
1 changed files with 5 additions and 1 deletions

View File

@ -4,10 +4,14 @@ echo "==========================================================================
echo " Prunes du "$(date) echo " Prunes du "$(date)
echo "================================================================================" echo "================================================================================"
START_TIME=$(date +"%s") START_TIME=$(date +"%s")
START_SIZE=$(du -s /var/backups/borg/ | awk '{ print $1 }')
borgmatic prune --stats --files --verbosity 1 borgmatic prune --stats --files --verbosity 1
echo "=====" echo "====="
DURATION=$(($(date +"%s")-$START_TIME)) DURATION=$(($(date +"%s")-$START_TIME))
echo "Ended at: "$(date)" Duration: "$(printf "%02d:%02d:%02d" $((DURATION/60/60)) $((DURATION/60%60)) $((DURATION%60))) DURATION=$(printf "%02d:%02d:%02d" $((DURATION/60/60)) $((DURATION/60%60)) $((DURATION%60)))
END_SIZE=$(du -s /var/backups/borg/ | awk '{ print $1 }')
DIFF_SIZE=$(((END_SIZE-START_SIZE)/1024))
echo "Ended at: "$(date)" Duration: $DURATION Size: $DIFF_SIZE MB"
echo "================================================================================" echo "================================================================================"