From 2a4dddf3768a52d0a4221c5d0788beb3d9a02ab5 Mon Sep 17 00:00:00 2001 From: Naglfar Date: Thu, 21 Oct 2021 16:54:02 +0200 Subject: [PATCH] Keep a second backup set --- roles/shell/files/usr/local/bin/backup | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/shell/files/usr/local/bin/backup b/roles/shell/files/usr/local/bin/backup index 61b86de..ac17540 100644 --- a/roles/shell/files/usr/local/bin/backup +++ b/roles/shell/files/usr/local/bin/backup @@ -6,7 +6,7 @@ BACKUPS=/var/backups DUMPS=7 LEVEL0=$(find $BACKUPS -name "*full.tgz" | sort | tail -n1) -INCR=$(find $BACKUPS -name "*incremental.tgz" | wc -l) +INCR=$(find $BACKUPS -name "*incremental.tgz" -newer $LEVEL0 | wc -l) if [ ! -z $LEVEL0 ] && [ $INCR -le $DUMPS ] then