Skip to content

Commit

Permalink
add DUMP_DELETE_DAYS to elabctl.conf and allow disabling feature
Browse files Browse the repository at this point in the history
fix #33
NicolasCARPi committed Jun 10, 2023
1 parent 886dcce commit 2b90bbd
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 5 additions & 0 deletions elabctl.conf
Original file line number Diff line number Diff line change
@@ -19,6 +19,11 @@
# name of the mysql container (default: mysql)
#declare ELAB_MYSQL_CONTAINER_NAME='mysql'

# defines the time until older mysql dumps will be deleted (+0 = older than 24h, +1 = older than 48h and so on)
# this value will be passed to the -ctime argument of find command
# set to "disabled" to disable pruning
#declare DUMP_DELETE_DAYS=+0


#############################
# BORG BACKUP CONFIGURATION #
4 changes: 3 additions & 1 deletion elabctl.sh
Original file line number Diff line number Diff line change
@@ -409,7 +409,9 @@ function mysql-backup
# compress it to the max
gzip -f --best "$dumpfile"
# delete old dumps
find ${BACKUP_DIR} -mindepth 1 -name '*.sql.gz' -ctime ${DUMP_DELETE_DAYS} -delete
if [[ "${DUMP_DELETE_DAYS}" != "disabled" ]]; then
find ${BACKUP_DIR} -mindepth 1 -name '*.sql.gz' -ctime ${DUMP_DELETE_DAYS} -delete
fi
}

function refresh

0 comments on commit 2b90bbd

Please sign in to comment.