Reducing the chance of name conflicts
This commit is contained in:
@@ -21,7 +21,6 @@ fi
|
|||||||
|
|
||||||
echo Begin backup schedule:
|
echo Begin backup schedule:
|
||||||
echo Date: $(date)
|
echo Date: $(date)
|
||||||
echo $'\n'
|
|
||||||
|
|
||||||
while read line; do
|
while read line; do
|
||||||
|
|
||||||
@@ -57,9 +56,9 @@ while read line; do
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# count backup file
|
# 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
|
# keep up to 7 backup
|
||||||
if [ $fCount -ne 7 ]; then
|
if [ $fCount -ne 7 ]; then
|
||||||
@@ -72,6 +71,7 @@ while read line; do
|
|||||||
if [ 0 -lt $dCount ]; then
|
if [ 0 -lt $dCount ]; then
|
||||||
|
|
||||||
# remove expired file
|
# remove expired file
|
||||||
|
echo " Removing expired backup: "$files
|
||||||
rm "$files";
|
rm "$files";
|
||||||
|
|
||||||
# dCount --
|
# dCount --
|
||||||
|
Reference in New Issue
Block a user