adding NICE and NICE_VAL and ability to override backup numbers in config
This commit is contained in:
parent
35f979e8fa
commit
5153376828
2 changed files with 22 additions and 3 deletions
|
@ -22,9 +22,11 @@ BU_FROOT_WEEKLY=weekly
|
||||||
BU_FROOT_MONTHLY=monthly
|
BU_FROOT_MONTHLY=monthly
|
||||||
BU_FROOT_YEARLY=yearly
|
BU_FROOT_YEARLY=yearly
|
||||||
#
|
#
|
||||||
|
# Set backup priority: -20 highest, 0 default, 19 lowest
|
||||||
|
NICE_VAL=0
|
||||||
# this can be overridden at invocation
|
# this can be overridden at invocation
|
||||||
BU_CONF=default-docker-compose.conf
|
BU_CONF=default-docker-compose.conf
|
||||||
# # output for debugging...
|
# output for debugging... 0 = false, 1 = true
|
||||||
VERBOSE=0
|
VERBOSE=0
|
||||||
#
|
#
|
||||||
# Stuff that should be universal for this install...
|
# Stuff that should be universal for this install...
|
||||||
|
@ -49,6 +51,8 @@ MAIL=`which mail`
|
||||||
# database dump utility
|
# database dump utility
|
||||||
DC=`which docker-compose`
|
DC=`which docker-compose`
|
||||||
#DEF_ARGS="-C -d -O -x"
|
#DEF_ARGS="-C -d -O -x"
|
||||||
|
# nice
|
||||||
|
NICE=`which nice`
|
||||||
#
|
#
|
||||||
# pattern for "ls" command to build list of
|
# pattern for "ls" command to build list of
|
||||||
# pruneable backup files...
|
# pruneable backup files...
|
||||||
|
@ -142,7 +146,7 @@ do_backup() {
|
||||||
echo "-- PostgreSQL Version: $VER" >> $FILE
|
echo "-- PostgreSQL Version: $VER" >> $FILE
|
||||||
echo "--" >> $FILE
|
echo "--" >> $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"
|
verbose "doing database dump: $CMD"
|
||||||
$CMD >> $FILE
|
$CMD >> $FILE
|
||||||
}
|
}
|
||||||
|
@ -230,7 +234,7 @@ do_backup $FILEPATH $DC_CONTAINER
|
||||||
message "completed backup"
|
message "completed backup"
|
||||||
# compress the backup
|
# compress the backup
|
||||||
message "compressing $FILEPATH"
|
message "compressing $FILEPATH"
|
||||||
$GZIP $FILEPATH
|
$NICE -${NICE_VAL} $GZIP $FILEPATH
|
||||||
# return to where you started from...
|
# return to where you started from...
|
||||||
cd $OLD_DIR
|
cd $OLD_DIR
|
||||||
#
|
#
|
||||||
|
|
|
@ -17,3 +17,18 @@ DUMP_CMD='pg_dumpall -c -U postgres'
|
||||||
# email address to send reports to, and subject
|
# email address to send reports to, and subject
|
||||||
EMAIL=webmaster@oerfoundation.org
|
EMAIL=webmaster@oerfoundation.org
|
||||||
EMAIL_SUBJ="Mastodon on OERu Open Postgres Backup Report"
|
EMAIL_SUBJ="Mastodon on OERu Open Postgres Backup Report"
|
||||||
|
#
|
||||||
|
# Optional overrides
|
||||||
|
#
|
||||||
|
# Default retention
|
||||||
|
#BU_TO_KEEP_HOURLY=24
|
||||||
|
#BU_TO_KEEP_DAILY=7
|
||||||
|
#BU_TO_KEEP_WEEKLY=4
|
||||||
|
#BU_TO_KEEP_MONTHLY=12
|
||||||
|
#BU_TO_KEEP_YEARLY=7
|
||||||
|
#
|
||||||
|
# Set backup priority: -20 highest, 0 default, 19 lowest
|
||||||
|
#NICE_VAL=0
|
||||||
|
#
|
||||||
|
# Verbosity 0 = false, 1 = true
|
||||||
|
#VERBOSE=0
|
||||||
|
|
Loading…
Reference in a new issue