From df8ae4090727118ebb5e0ad41cb9bcc8219e1453 Mon Sep 17 00:00:00 2001 From: Joseph Hanson Date: Fri, 3 Jan 2025 19:49:01 -0600 Subject: [PATCH] increase to 7 now that it's pushing to larger storage --- nixos/hosts/varda/resources/prune-backups.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/nixos/hosts/varda/resources/prune-backups.sh b/nixos/hosts/varda/resources/prune-backups.sh index 5f1fe48..2c8779a 100644 --- a/nixos/hosts/varda/resources/prune-backups.sh +++ b/nixos/hosts/varda/resources/prune-backups.sh @@ -1,14 +1,13 @@ # Set the backup directory BACKUP_DIR="/mnt/storage/forgejo/backups" -# Keep the 3 most recent backups KEEP_NUM=7 echo "Starting backup cleanup process..." echo "Keeping the $KEEP_NUM most recent backups in $BACKUP_DIR" # Find all backup files, sort by modification time (newest first), -# skip the first 3, and delete the rest +# skip the first KEEP_NUM, and delete the rest find "$BACKUP_DIR" -type f -name "forgejo-dump-*" -print0 | sort -z -t_ -k2 -r | tail -z -n +$((KEEP_NUM + 1)) |