From e32bb89cd621c5c254c5f60a86a15bb48130dae0 Mon Sep 17 00:00:00 2001 From: Rob Nickmans Date: Fri, 6 Dec 2024 14:41:33 +0100 Subject: [PATCH] fix: wrong regex for wal retention (#1026) --- postgres-appliance/scripts/postgres_backup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/postgres-appliance/scripts/postgres_backup.sh b/postgres-appliance/scripts/postgres_backup.sh index 3216ae4ed..9b9a4723a 100755 --- a/postgres-appliance/scripts/postgres_backup.sh +++ b/postgres-appliance/scripts/postgres_backup.sh @@ -55,7 +55,7 @@ while read -r name last_modified rest; do # count how many backups will remain after we remove everything up to certain date ((LEFT=LEFT+1)) fi -done < <($WAL_E backup-list 2> /dev/null | sed '0,/^name\s*\(last_\)\?modified\s*/d') +done < <($WAL_E backup-list 2> /dev/null | sed '0,/^\(backup_\)\?name\s*\(last_\)\?modified\s*/d') # we want keep at least N backups even if the number of days exceeded if [ -n "$BEFORE" ] && [ $LEFT -ge $DAYS_TO_RETAIN ]; then