added a MAIN_DIR variable, and tweaked the conf sample and cron files to reflect how this is deployed in practice
This commit is contained in:
parent
5642cfc67c
commit
4eec9fbcf9
3 changed files with 13 additions and 17 deletions
|
@ -33,7 +33,7 @@ VERBOSE=1
|
|||
#
|
||||
# Stuff that should be universal for this install...
|
||||
# where we can find this app...
|
||||
MAIN_DIR=/home/dave/sqlite_backup
|
||||
#MAIN_DIR=/home//sqlite_backup
|
||||
# determine today's date
|
||||
DATE=`date '+%Y-%m-%d-%a'`
|
||||
# determine today's date
|
||||
|
@ -196,11 +196,11 @@ if ! [[ $TASK == 'HOURLY' ]] ; then
|
|||
create_tmp_email
|
||||
fi
|
||||
#
|
||||
if test -f $MAIN_DIR/$BU_CONF ; then
|
||||
verbose "Reading default in $MAIN_DIR/$BU_CONF"
|
||||
source $MAIN_DIR/$BU_CONF
|
||||
if test -f $BU_CONF ; then
|
||||
verbose "Reading default in $BU_CONF"
|
||||
source $BU_CONF
|
||||
else
|
||||
message "ERROR: Couldn't find or read $MAIN_DIR/$BU_CONF"
|
||||
message "ERROR: Couldn't find or read $BU_CONF"
|
||||
exit 1
|
||||
fi
|
||||
#
|
||||
|
|
|
@ -5,16 +5,16 @@ PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
|
|||
# run system backups
|
||||
#
|
||||
# hourly - at 5 minutes past mon-sat
|
||||
05 * * * * root /home/data/scripts/sqlite-backup/sqlite_backup --hourly
|
||||
05 * * * * root cd /home/data/[bw_dir]/scripts/sqlite-backup && ./sqlite_backup --hourly
|
||||
#
|
||||
# daily - at 7:30 pm, mon-sat
|
||||
30 19 * * * root /home/data/scripts/sqlite-backup/sqlite_backup --daily
|
||||
30 19 * * * root /home/data/[bw_dir]/scripts/sqlite-backup && ./sqlite_backup --daily
|
||||
#
|
||||
# weekly - at 7:30 pm, sun
|
||||
30 19 * * sun root /home/data/scripts/sqlite-backup/sqlite_backup --weekly
|
||||
30 19 * * sun root /home/data/[bw_dir]/scripts/sqlite-backup && ./sqlite_backup --weekly
|
||||
#
|
||||
# monthly - at 8:30 pm, on the first of the last of the month
|
||||
30 20 1 * * root /home/data/scripts/sqlite-backup/sqlite_backup --monthly
|
||||
30 20 1 * * root /home/data/[bw_dir]/scripts/sqlite-backup && ./sqlite_backup --monthly
|
||||
#
|
||||
# yearly - at 8:30 pm, on the first of January.
|
||||
30 20 1 1 * root /home/data/scripts/sqlite-backup/sqlite_backup --yearly
|
||||
30 20 1 1 * root /home/data/[bw_dir]/scripts/sqlite-backup && ./sqlite_backup --yearly
|
||||
|
|
|
@ -1,20 +1,16 @@
|
|||
#
|
||||
# SQL dump backup directory
|
||||
#
|
||||
MAIN_DIR=/path/to/base/directory
|
||||
# backup file details
|
||||
BU_DIR=/path/to/directory/for/backups
|
||||
BU_DIR=$MAIN_DIR/backups
|
||||
# each backup will start with this basename
|
||||
BU_FROOT=preferred-basename
|
||||
#
|
||||
# location of sqlite database
|
||||
DB_DIR=/path/to/database/directory
|
||||
DB_DIR=$MAIN_DIR/data
|
||||
DB_FILE=your-db.sqlite3
|
||||
#
|
||||
# docker compose settings
|
||||
DC_DIR=/path/to/directory/containing/your/docker-compose.yml
|
||||
# this is the name at the top of your docker-compose.yml stanza describing the container running SQLite
|
||||
DC_CONT=name_of_your_container
|
||||
#
|
||||
# Reporting
|
||||
#
|
||||
# email address to send reports to, and subject
|
||||
|
|
Loading…
Reference in a new issue