Update 'templates/postgresql-backup.sh.j2'
This commit is contained in:
parent
a4ceaaf5b2
commit
8b13a1377c
|
@ -49,9 +49,9 @@ cleanup_old_backups() {
|
||||||
# find ${HISTDIR} -mtime +${N_DAYS_TO_SPARE} -type f -exec rm -fv {} \;
|
# find ${HISTDIR} -mtime +${N_DAYS_TO_SPARE} -type f -exec rm -fv {} \;
|
||||||
ORD_DUMP_TO_DEL=$( expr $N_DAYS_TO_SPARE + 1 )
|
ORD_DUMP_TO_DEL=$( expr $N_DAYS_TO_SPARE + 1 )
|
||||||
TODELETE=$( /bin/ls "${HISTDIR}/" | awk -F '.' '{print $NF}' | sort -ruV | tail -n +${ORD_DUMP_TO_DEL} )
|
TODELETE=$( /bin/ls "${HISTDIR}/" | awk -F '.' '{print $NF}' | sort -ruV | tail -n +${ORD_DUMP_TO_DEL} )
|
||||||
for i in ${TODELETE}
|
for DATETODELETE in ${TODELETE}
|
||||||
do
|
do
|
||||||
rm -f "${HISTDIR}/*.${i}"
|
rm -fv ${HISTDIR}/*.${DATETODELETE}
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue