Merge pull request 'Update 'templates/postgresql-backup.sh.j2'' (!4) from tpiccioli-patch-1 into master
Reviewed-on: #4
This commit is contained in:
commit
c38d2fb895
|
@ -46,12 +46,13 @@ create_backup_dirs() {
|
||||||
|
|
||||||
cleanup_old_backups() {
|
cleanup_old_backups() {
|
||||||
# Remove the old backups
|
# Remove the 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 {} \;
|
||||||
# TODELETE=$( /bin/ls "${HISTDIR}/" | awk -F '.' '{print $NF}' | sort -ruV | tail -n +${N_DAYS_TO_SPARE} )
|
ORD_DUMP_TO_DEL=$( expr $N_DAYS_TO_SPARE + 1 )
|
||||||
# for i in ${TODELETE}
|
TODELETE=$( /bin/ls "${HISTDIR}/" | awk -F '.' '{print $NF}' | sort -ruV | tail -n +${ORD_DUMP_TO_DEL} )
|
||||||
# do
|
for i in ${TODELETE}
|
||||||
# rm -f "${HISTDIR}/*.${i}"
|
do
|
||||||
# done
|
rm -f "${HISTDIR}/*.${i}"
|
||||||
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
create_db_list() {
|
create_db_list() {
|
||||||
|
@ -118,6 +119,8 @@ fix_backup_permissions() {
|
||||||
#
|
#
|
||||||
umask 0077
|
umask 0077
|
||||||
|
|
||||||
|
cleanup_old_backups
|
||||||
|
|
||||||
create_backup_dirs
|
create_backup_dirs
|
||||||
if [ "$BUILD_DBLIST" == "yes" ] ; then
|
if [ "$BUILD_DBLIST" == "yes" ] ; then
|
||||||
create_db_list
|
create_db_list
|
||||||
|
@ -150,6 +153,5 @@ else
|
||||||
fi
|
fi
|
||||||
|
|
||||||
fix_backup_permissions
|
fix_backup_permissions
|
||||||
cleanup_old_backups
|
|
||||||
|
|
||||||
exit $RETVAL
|
exit $RETVAL
|
||||||
|
|
Loading…
Reference in New Issue