From 1bbe4f4de467b21c6e7cc55e635db6ca8c080450 Mon Sep 17 00:00:00 2001 From: Andrea Dell'Amico Date: Mon, 12 Nov 2018 16:49:18 +0100 Subject: [PATCH] library/roles/postgresql/files/postgresql-backup.sh: Use a variable to build the correct backup directory. --- postgresql/files/postgresql-backup.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/postgresql/files/postgresql-backup.sh b/postgresql/files/postgresql-backup.sh index 64d20820..3247c7bf 100755 --- a/postgresql/files/postgresql-backup.sh +++ b/postgresql/files/postgresql-backup.sh @@ -41,10 +41,10 @@ create_backup_dirs() { cleanup_old_backups() { # Remove the old backups - TODELETE=`ls /var/lib/pgsql/backups/history | awk -F '.' '{print $NF}' | sort -ruV | tail -n +${N_DAYS_TO_SPARE}` + TODELETE=`ls ${$BACKUPDIR}/history | awk -F '.' '{print $NF}' | sort -ruV | tail -n +${N_DAYS_TO_SPARE}` for i in ${TODELETE} do - rm -f /var/lib/pgsql/backups/history/*.$i + rm -f ${$BACKUPDIR}/history/*.$i done }