diff --git a/bash/cronbackup/backup.sh b/bash/cronbackup/backup.sh index d6b3481..a841a5f 100644 --- a/bash/cronbackup/backup.sh +++ b/bash/cronbackup/backup.sh @@ -59,11 +59,11 @@ while read line; do echo " Check for existing backups "$FILENAME \(Have: $fCount\) - # keep up to 7 backup - if [ $fCount -ne 7 ]; then + # keep up to X backups + if [ $fCount -ne $KEEP ]; then # delete count - dCount=`expr $fCount - 7` + dCount=`expr $fCount - $KEEP` # loop over files for files in $BAKDIR/*$FILENAME*.gz; do diff --git a/bash/cronbackup/config.sh b/bash/cronbackup/config.sh index 319ecee..49be805 100644 --- a/bash/cronbackup/config.sh +++ b/bash/cronbackup/config.sh @@ -5,3 +5,5 @@ ERRLOG=backup_errors.log BMOUNT=/mnt/backup BAKDIR=$BMOUNT/backup/cron + +KEEP=7