Consolidate config into sky-cam.conf; systemd failure notifications
sky-cam.conf (new) - Single file replaces mattermost_config.txt reference, notify_config.txt, and the hardcoded BASE_DIR/MUSIC_DIR/TIMEZONE scattered across scripts - Bash-sourceable and Python key=value readable (same format) All .sh scripts - source sky-cam.conf at startup; BASE_DIR / MUSIC_DIR from config sunrise2mm.py - Reads sky-cam.conf relative to script location; no hardcoded path notify.sh - Sources sky-cam.conf; Mattermost credentials come from there directly, no separate mattermost_config.txt lookup needed systemd/sky-cam-notify-failure@.service (new) - Template unit called by OnFailure= in each service - Sends notification via notify.sh when any sky-cam job fails - All three .service units now have OnFailure=sky-cam-notify-failure@%n.service Removed: notify_config.txt, sky-cam.crontab (superseded) https://claude.ai/code/session_01C4jbd3waXG3eKZYbGUjLUQ
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
Description=Sky-Cam Four Seasons daily clip (+ montage trigger on last day)
|
||||
After=network-online.target
|
||||
Wants=network-online.target
|
||||
OnFailure=sky-cam-notify-failure@%n.service
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
[Unit]
|
||||
Description=Sky-Cam full-day timelapse (10-day retention)
|
||||
OnFailure=sky-cam-notify-failure@%n.service
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
[Unit]
|
||||
Description=Sky-Cam failure notification for %i
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
# %i is the name of the failed unit (passed by OnFailure=)
|
||||
# Edit ExecStart path to match your install location.
|
||||
ExecStart=/home/motion/drives/local-2tb/sunrise-scripts/notify.sh \
|
||||
"sky-cam job failed: %i" \
|
||||
"systemd unit %i exited with failure. Check logs: journalctl -u %i"
|
||||
@@ -2,6 +2,7 @@
|
||||
Description=Sky-Cam daily sunrise video → Mattermost
|
||||
After=network-online.target
|
||||
Wants=network-online.target
|
||||
OnFailure=sky-cam-notify-failure@%n.service
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
|
||||
Reference in New Issue
Block a user