diff --git a/CHANGELOG.md b/CHANGELOG.md index 643d940..d2aec44 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog for elabctl +## Version 3.6.0 + +* Allow setting `BORG_REMOTE_PATH` env var for `borg` backup. (fix elabftw/elabftw#4798) + ## Version 3.5.0 * Change `bin/console db:install` to new `bin/init db:install` diff --git a/elabctl.conf b/elabctl.conf index 918d439..4b782ba 100644 --- a/elabctl.conf +++ b/elabctl.conf @@ -43,3 +43,6 @@ # granularity of backups to keep declare BORG_KEEP_DAILY=14 declare BORG_KEEP_MONTHLY=6 + +# optional, only set if required (rsync.net) +#declare BORG_REMOTE_PATH=borg1 diff --git a/elabctl.sh b/elabctl.sh index 2fe5565..3834385 100755 --- a/elabctl.sh +++ b/elabctl.sh @@ -3,7 +3,7 @@ # https://github.com/elabftw/elabctl/ # © 2022 Nicolas CARPi @ Deltablot # License: GPLv3 -declare -r ELABCTL_VERSION='3.5.0' +declare -r ELABCTL_VERSION='3.6.0' # default backup dir declare BACKUP_DIR='/var/backups/elabftw' @@ -55,6 +55,9 @@ function borg-backup # add these into env so it is picked up by borg export BORG_REPO="${BORG_REPO}" export BORG_PASSPHRASE="${BORG_PASSPHRASE}" + if [ -n "$BORG_REMOTE_PATH" ]; then + 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}" prune --keep-daily="${BORG_KEEP_DAILY:-14}" --keep-monthly="${BORG_KEEP_MONTHLY:-6}"