Reducing the chance of name conflicts
This commit is contained in:
parent
f79fa902fc
commit
541b71e9ac
@ -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 --
|
||||
|
Loading…
Reference in New Issue
Block a user