|
@@ -30,9 +30,16 @@ else
|
|
fi
|
|
fi
|
|
|
|
|
|
# Prune old backups using a custom SSH port
|
|
# 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
|
|
if [ $? -ne 0 ]; then
|
|
echo "Borg prune failed."
|
|
echo "Borg prune failed."
|
|
exit 1
|
|
exit 1
|
|
|
|
+fi
|
|
|
|
+
|
|
|
|
+sudo -E borg compact
|
|
|
|
+
|
|
|
|
+if [ $? -ne 0 ]; then
|
|
|
|
+ echo "Borg compact failed."
|
|
|
|
+ exit 1
|
|
fi
|
|
fi
|