diff --git a/bash/cronbackup/backup.sh b/bash/cronbackup/backup.sh index f816d15..a50cbd4 100644 --- a/bash/cronbackup/backup.sh +++ b/bash/cronbackup/backup.sh @@ -21,7 +21,6 @@ fi echo Begin backup schedule: echo Date: $(date) -echo $'\n' while read line; do @@ -57,9 +56,9 @@ while read line; do fi # count backup file - fCount=$(ls $BAKDIR/*$FILENAME*.gz|wc -l) + fCount=$(ls $BAKDIR/$FILENAME.[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9].tar.gz|wc -l) - echo Checking for expired backups $FILENAME \($fCount\) + echo " Check for existing backups "$FILENAME \(Have: $fCount\) # keep up to 7 backup if [ $fCount -ne 7 ]; then @@ -72,6 +71,7 @@ while read line; do if [ 0 -lt $dCount ]; then # remove expired file + echo " Removing expired backup: "$files rm "$files"; # dCount --