library/roles/postgresql/files/postgresql-backup.sh: Use a variable to build the correct backup directory.

This commit is contained in:
Andrea Dell'Amico 2018-11-12 16:49:18 +01:00
parent 919054d310
commit 1bbe4f4de4
1 changed files with 2 additions and 2 deletions

View File

@ -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
}