Document backup pipeline behaviour
This commit is contained in:
1 parent
22acd4f20c
commit
5d07cc4f54
10 files changed
+80
-8
No files matched your search
@@ -1,5 +1,7 @@
|
||||
#!/usr/bin/env bash
|
||||
# Listen for an authenticated JSON command and run the backup pipeline.
|
||||
# Long-running MQTT command listener, normally managed by systemd as root.
|
||||
# Accepts only {"action":"run"}; broker authentication and ACLs should restrict
|
||||
# who can publish to MQTT_COMMAND_TOPIC.
|
||||
set -Eeuo pipefail
|
||||
SCRIPT_DIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")/.." && pwd -P)"
|
||||
. "$SCRIPT_DIR/lib/common.sh"
|
||||
@@ -20,5 +22,7 @@ mosquitto_sub "${MQTT_ARGS[@]}" -R -t "$MQTT_COMMAND_TOPIC" | while IFS= read -r
|
||||
continue
|
||||
fi
|
||||
log MQTT "Accepted backup run command"
|
||||
# backup.sh owns concurrency control. A command received during an active run
|
||||
# fails safely on the same flock used by cron and manual invocations.
|
||||
"$SCRIPT_DIR/backup.sh" || log ERROR "MQTT-triggered backup failed"
|
||||
done
|
||||
Reference in new issue
Block a user