increase to 7 now that it's pushing to larger storage
This commit is contained in:
parent
5a09a0d8b6
commit
df8ae40907
1 changed files with 1 additions and 2 deletions
|
@ -1,14 +1,13 @@
|
||||||
# Set the backup directory
|
# Set the backup directory
|
||||||
BACKUP_DIR="/mnt/storage/forgejo/backups"
|
BACKUP_DIR="/mnt/storage/forgejo/backups"
|
||||||
|
|
||||||
# Keep the 3 most recent backups
|
|
||||||
KEEP_NUM=7
|
KEEP_NUM=7
|
||||||
|
|
||||||
echo "Starting backup cleanup process..."
|
echo "Starting backup cleanup process..."
|
||||||
echo "Keeping the $KEEP_NUM most recent backups in $BACKUP_DIR"
|
echo "Keeping the $KEEP_NUM most recent backups in $BACKUP_DIR"
|
||||||
|
|
||||||
# Find all backup files, sort by modification time (newest first),
|
# 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 |
|
find "$BACKUP_DIR" -type f -name "forgejo-dump-*" -print0 |
|
||||||
sort -z -t_ -k2 -r |
|
sort -z -t_ -k2 -r |
|
||||||
tail -z -n +$((KEEP_NUM + 1)) |
|
tail -z -n +$((KEEP_NUM + 1)) |
|
||||||
|
|
Loading…
Reference in a new issue