The number of dumps is updated
This commit is contained in:
parent
614f143599
commit
cf22ee03f1
|
@ -3,12 +3,12 @@
|
||||||
|
|
||||||
DATE=$(date +%Y%m%d)
|
DATE=$(date +%Y%m%d)
|
||||||
BACKUPS=/var/backups
|
BACKUPS=/var/backups
|
||||||
DUMPS=8
|
DUMPS=7
|
||||||
|
|
||||||
LEVEL0=$(find $BACKUPS -name "*full.tgz")
|
LEVEL0=$(find $BACKUPS -name "*full.tgz")
|
||||||
INCR=$(find $BACKUPS -name "*incremental.tgz" | wc -l)
|
INCR=$(find $BACKUPS -name "*incremental.tgz" | wc -l)
|
||||||
|
|
||||||
if [ -e $LEVEL0 ] && [ $INCR -le $DUMPS ]
|
if [ -e $LEVEL0 ] && [ $INCR -gt $DUMPS ]
|
||||||
then
|
then
|
||||||
TYPE=incremental
|
TYPE=incremental
|
||||||
else
|
else
|
||||||
|
@ -45,7 +45,7 @@ chmod 640 $BACKUPS/*.tgz
|
||||||
if [ $TYPE = full ]
|
if [ $TYPE = full ]
|
||||||
then
|
then
|
||||||
cp $BACKUPS/full.snapshot $BACKUPS/incremental.snapshot
|
cp $BACKUPS/full.snapshot $BACKUPS/incremental.snapshot
|
||||||
# Remove dumps and the previous backup once there is another.
|
# Remove dumps and the previous backup if there is another one.
|
||||||
[ -e $LEVEL0 ] && rm $LEVEL0 $BACKUPS/*incremental.tgz
|
[ -e $LEVEL0 ] && rm $LEVEL0 $BACKUPS/*incremental.tgz
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue