fix backup count for today

This commit is contained in:
2022-11-02 13:30:56 +01:00
parent 41bf857ba9
commit e814ad126c
+2 -1
View File
@@ -92,7 +92,8 @@ function getBorgDataForRepository {
COUNTER=$(echo "$ARCHIVES" | wc -l)
TODAY=$(date +%Y-%m-%d)
BACKUPS_TODAY=$(echo "$ARCHIVES" | grep ", $TODAY ")
BACKUPS_TODAY_COUNT=$(echo -n "$BACKUPS_TODAY" | wc -l)
# Get correct Backup Count echo -n removes by 3 Backups got only 2, added sed command
BACKUPS_TODAY_COUNT=$(echo "$BACKUPS_TODAY" | sed '/^\s*$/d' | wc -l)
#extract data for last archive
LAST_ARCHIVE=$(BORG_PASSPHRASE=$BORG_PASSPHRASE borg list --last 1 $REPOSITORY)