fix: move log up
All checks were successful
CI / Build Docker image (pull_request) Successful in 19s
All checks were successful
CI / Build Docker image (pull_request) Successful in 19s
This commit is contained in:
@@ -1,6 +1,20 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
|
#######################################
|
||||||
|
# Date format for logging.
|
||||||
|
#######################################
|
||||||
|
LOG_DATE_FORMAT="%Y-%m-%dT%T"
|
||||||
|
|
||||||
|
#######################################
|
||||||
|
# Log a message with a timestamp.
|
||||||
|
# Arguments:
|
||||||
|
# Message to log.
|
||||||
|
#######################################
|
||||||
|
log() {
|
||||||
|
echo "$(date +"$LOG_DATE_FORMAT") - $*"
|
||||||
|
}
|
||||||
|
|
||||||
#######################################
|
#######################################
|
||||||
# Determine backup mode from the environment only.
|
# Determine backup mode from the environment only.
|
||||||
# Valid values: "directory" or "postgres".
|
# Valid values: "directory" or "postgres".
|
||||||
@@ -18,7 +32,7 @@ fi
|
|||||||
|
|
||||||
for cmd in "${REQUIRED_CMDS[@]}"; do
|
for cmd in "${REQUIRED_CMDS[@]}"; do
|
||||||
if ! command -v "$cmd" &>/dev/null; then
|
if ! command -v "$cmd" &>/dev/null; then
|
||||||
echo "Error: Required command '$cmd' is not installed." >&2
|
log "Error: Required command '$cmd' is not installed."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
@@ -75,20 +89,6 @@ if [ "$ENABLE_GOTIFY" = "true" ]; then
|
|||||||
GOTIFYURL="${GOTIFYHOST}/message?token=${GOTIFYTOKEN}"
|
GOTIFYURL="${GOTIFYHOST}/message?token=${GOTIFYTOKEN}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#######################################
|
|
||||||
# Date format for logging.
|
|
||||||
#######################################
|
|
||||||
LOG_DATE_FORMAT="%Y-%m-%dT%T"
|
|
||||||
|
|
||||||
#######################################
|
|
||||||
# Log a message with a timestamp.
|
|
||||||
# Arguments:
|
|
||||||
# Message to log.
|
|
||||||
#######################################
|
|
||||||
log() {
|
|
||||||
echo "$(date +"$LOG_DATE_FORMAT") - $*"
|
|
||||||
}
|
|
||||||
|
|
||||||
#######################################
|
#######################################
|
||||||
# Send a notification via Gotify.
|
# Send a notification via Gotify.
|
||||||
# Arguments:
|
# Arguments:
|
||||||
|
|||||||
Reference in New Issue
Block a user