Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions elabctl.conf
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,7 @@ declare BORG_KEEP_MONTHLY=6

# optional, only set if required (rsync.net)
#declare BORG_REMOTE_PATH=borg1

# optional, set a different path for uploaded files
# default is DATA_DIR/web
#declare UPLOADS_DIR=/path/to/uploaded_files
5 changes: 4 additions & 1 deletion elabctl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ declare ELABCTL_CONF_FILE="using default values (no config file found)"
# will be overridden by select-dc-cmd()
declare DC="docker compose"

# allow override default web subfolder in data dir
declare UPLOADS_DIR="${DATA_DIR}/web"

function access-logs
{
docker logs "${ELAB_WEB_CONTAINER_NAME}" 2>/dev/null
Expand Down Expand Up @@ -58,7 +61,7 @@ function borg-backup
export BORG_REMOTE_PATH="${BORG_REMOTE_PATH}"
fi
# we add to the borg the uploaded files (web directory) and also the backup dir containing dumps of MySQL
"${BORG_PATH}" create "::$(hostname)-$(date +%F_%H-%M)" "${DATA_DIR}/web" "${BACKUP_DIR}"
"${BORG_PATH}" create "::$(hostname)-$(date +%F_%H-%M)" "${UPLOADS_DIR}" "${BACKUP_DIR}"
"${BORG_PATH}" prune --keep-daily="${BORG_KEEP_DAILY:-14}" --keep-monthly="${BORG_KEEP_MONTHLY:-6}"
}

Expand Down