forked from ISTI-ansible-roles/ansible-roles
postgres backup, cleanup fixed
This commit is contained in:
parent
2681156ce2
commit
a00237de06
|
@ -41,7 +41,11 @@ create_backup_dirs() {
|
|||
|
||||
cleanup_old_backups() {
|
||||
# Remove the old backups
|
||||
find ${HISTDIR} -ctime +$N_DAYS_TO_SPARE -exec rm -f {} \;
|
||||
TODELETE=`ls /var/lib/pgsql/backups/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
|
||||
done
|
||||
}
|
||||
|
||||
create_db_list() {
|
||||
|
|
Loading…
Reference in New Issue