From 0ac74bb9cf0c3faa8f029adde352589c3b18725f Mon Sep 17 00:00:00 2001 From: "tommaso.piccioli" Date: Mon, 19 Nov 2018 17:47:19 +0100 Subject: [PATCH] postgres old dump remove fix --- postgresql/files/postgresql-backup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/postgresql/files/postgresql-backup.sh b/postgresql/files/postgresql-backup.sh index 76a837f0..1b7c8900 100755 --- a/postgresql/files/postgresql-backup.sh +++ b/postgresql/files/postgresql-backup.sh @@ -41,7 +41,7 @@ create_backup_dirs() { cleanup_old_backups() { # Remove the old backups - find ${HISTDIR} -ctime +${N_DAYS_TO_SPARE} -type f -exec rm -f {} \; + find ${HISTDIR} -atime +${N_DAYS_TO_SPARE} -type f -exec rm -f {} \; # TODELETE=$( /bin/ls "${HISTDIR}/" | awk -F '.' '{print $NF}' | sort -ruV | tail -n +${N_DAYS_TO_SPARE} ) # for i in ${TODELETE} # do