mirror of
https://github.com/luzifer-docker/pvc-rsync.git
synced 2024-11-09 15:50:01 +00:00
Add pre-sync command
Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
parent
60e2c1979e
commit
b9c28d5d11
1 changed files with 9 additions and 0 deletions
|
@ -14,6 +14,7 @@ set -euo pipefail
|
||||||
: ${PING_DOWN:=} # Send a ping (HTTP GET) to this URL when an exit-error ocurred
|
: ${PING_DOWN:=} # Send a ping (HTTP GET) to this URL when an exit-error ocurred
|
||||||
: ${PING_MAX_TIME:=5} # Time in seconds to timeout the ping request
|
: ${PING_MAX_TIME:=5} # Time in seconds to timeout the ping request
|
||||||
: ${PING_UP:=} # Send a ping (HTTP GET) to this URL when backup finished successfully
|
: ${PING_UP:=} # Send a ping (HTTP GET) to this URL when backup finished successfully
|
||||||
|
: ${PRE_CMD:=} # Execute command before backing up (i.e. script to backup sqlite db)
|
||||||
: ${REMOTE_HOST:=} # Where to send the backups
|
: ${REMOTE_HOST:=} # Where to send the backups
|
||||||
: ${SKIP_RESTORE_ON:=} # File to check, if exists restore will be skipped
|
: ${SKIP_RESTORE_ON:=} # File to check, if exists restore will be skipped
|
||||||
: ${SSH_CONFIG_MOUNT:=~/.ssh-dist} # Where to search for ~/.ssh contents to copy into ~/.ssh (Secret mountPath)
|
: ${SSH_CONFIG_MOUNT:=~/.ssh-dist} # Where to search for ~/.ssh contents to copy into ~/.ssh (Secret mountPath)
|
||||||
|
@ -150,6 +151,14 @@ function run_backup() {
|
||||||
|
|
||||||
info "Starting backup..."
|
info "Starting backup..."
|
||||||
|
|
||||||
|
[[ -z $PRE_CMD ]] || {
|
||||||
|
info "Running pre-command '${PRE_CMD}'..."
|
||||||
|
${PRE_CMD} || {
|
||||||
|
error "Failed to run pre-command."
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ensure_basedir || {
|
ensure_basedir || {
|
||||||
error "Failed to ensure base-dir."
|
error "Failed to ensure base-dir."
|
||||||
return 1
|
return 1
|
||||||
|
|
Loading…
Reference in a new issue