|
@@ -30,9 +30,16 @@ else
|
|
|
fi
|
|
|
|
|
|
# Prune old backups using a custom SSH port
|
|
|
-sudo -E borg prune --keep-daily=7 --keep-weekly=4 --keep-monthly=6 "$SERVER_USER@$SERVER_IP:$REPOSITORY"
|
|
|
+sudo -E borg prune --glob-archives '{hostname}-*' --keep-daily=7 --keep-weekly=4 --keep-monthly=6 --keep-yearly=10 "$SERVER_USER@$SERVER_IP:$REPOSITORY"
|
|
|
|
|
|
if [ $? -ne 0 ]; then
|
|
|
echo "Borg prune failed."
|
|
|
exit 1
|
|
|
+fi
|
|
|
+
|
|
|
+sudo -E borg compact
|
|
|
+
|
|
|
+if [ $? -ne 0 ]; then
|
|
|
+ echo "Borg compact failed."
|
|
|
+ exit 1
|
|
|
fi
|