adding NICE and NICE_VAL and ability to override backup numbers in config

This commit is contained in:
Dave Lane 2022-11-25 16:17:05 +13:00
parent 35f979e8fa
commit 5153376828
2 changed files with 22 additions and 3 deletions

View file

@ -22,9 +22,11 @@ BU_FROOT_WEEKLY=weekly
BU_FROOT_MONTHLY=monthly
BU_FROOT_YEARLY=yearly
#
# Set backup priority: -20 highest, 0 default, 19 lowest
NICE_VAL=0
# this can be overridden at invocation
BU_CONF=default-docker-compose.conf
# # output for debugging...
# output for debugging... 0 = false, 1 = true
VERBOSE=0
#
# Stuff that should be universal for this install...
@ -49,6 +51,8 @@ MAIL=`which mail`
# database dump utility
DC=`which docker-compose`
#DEF_ARGS="-C -d -O -x"
# nice
NICE=`which nice`
#
# pattern for "ls" command to build list of
# pruneable backup files...
@ -142,7 +146,7 @@ do_backup() {
echo "-- PostgreSQL Version: $VER" >> $FILE
echo "--" >> $FILE
echo "" >> $FILE
CMD="$DC exec $CONTAINER $DUMP_CMD"
CMD="$NICE -${NICE_VAL} $DC exec $CONTAINER $DUMP_CMD"
verbose "doing database dump: $CMD"
$CMD >> $FILE
}
@ -230,7 +234,7 @@ do_backup $FILEPATH $DC_CONTAINER
message "completed backup"
# compress the backup
message "compressing $FILEPATH"
$GZIP $FILEPATH
$NICE -${NICE_VAL} $GZIP $FILEPATH
# return to where you started from...
cd $OLD_DIR
#