From cf22ee03f146924ef06be6a22a7a799c5ec888c8 Mon Sep 17 00:00:00 2001 From: Naglfar Date: Sun, 3 Oct 2021 15:31:08 +0200 Subject: [PATCH] The number of dumps is updated --- roles/shell/files/usr/local/bin/backup | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/roles/shell/files/usr/local/bin/backup b/roles/shell/files/usr/local/bin/backup index ee10aa7..2fd1a4b 100644 --- a/roles/shell/files/usr/local/bin/backup +++ b/roles/shell/files/usr/local/bin/backup @@ -3,12 +3,12 @@ DATE=$(date +%Y%m%d) BACKUPS=/var/backups -DUMPS=8 +DUMPS=7 LEVEL0=$(find $BACKUPS -name "*full.tgz") INCR=$(find $BACKUPS -name "*incremental.tgz" | wc -l) -if [ -e $LEVEL0 ] && [ $INCR -le $DUMPS ] +if [ -e $LEVEL0 ] && [ $INCR -gt $DUMPS ] then TYPE=incremental else @@ -45,7 +45,7 @@ chmod 640 $BACKUPS/*.tgz if [ $TYPE = full ] then 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 fi