Multi-camera support; schedules in conf; comment out notifications
sky-cam.conf: - CAMERAS array replaces single CAM_NAME; add a name, add its schedules, re-run install.sh — no script editing needed - SCHEDULE_SUNRISE, SCHEDULE_SEASONS_<cam>, SCHEDULE_FULLDAY_<cam> replace hardcoded times in install.sh - Notification options commented out (uncomment to enable) - Lat/lon set to mid-Atlantic (25.0, -38.0) as neutral placeholder install.sh: - Loops over CAMERAS to generate per-camera sky-cam-seasons-<cam> and sky-cam-fullday-<cam> timers with schedules from conf - Sunrise timer remains a single sky-cam-sunrise unit (SUNRISE_CAM only) fullday-video.sh, 4-seasons.sh, montage-mvt.sh, year-end-join.sh: - Each accepts camera name as an argument (systemd passes it via ExecStart) and falls back to conf default when run manually without an arg - Camera name propagates through the full call chain: 4-seasons → montage-mvt → year-end-join https://claude.ai/code/session_01C4jbd3waXG3eKZYbGUjLUQ
This commit is contained in:
+87
-62
@@ -20,13 +20,14 @@
|
||||
# Then edit ExecStart= in each .service file to match your SCRIPT_DIR, then:
|
||||
#
|
||||
# systemctl --user daemon-reload
|
||||
# systemctl --user enable --now sky-cam-sunrise.timer # 09:00 daily
|
||||
# systemctl --user enable --now sky-cam-4seasons.timer # 01:00 daily
|
||||
# systemctl --user enable --now sky-cam-fullday.timer # 02:00 daily
|
||||
# systemctl --user enable --now sky-cam-sunrise.timer
|
||||
# systemctl --user enable --now sky-cam-seasons-sunrise.timer
|
||||
# systemctl --user enable --now sky-cam-fullday-sunrise.timer
|
||||
# # one sky-cam-seasons-<cam>.timer and sky-cam-fullday-<cam>.timer per camera
|
||||
#
|
||||
# Check status:
|
||||
# systemctl --user list-timers 'sky-cam-*'
|
||||
# journalctl --user -u sky-cam-4seasons.service -f
|
||||
# journalctl --user -u sky-cam-seasons-sunrise.service -f
|
||||
#
|
||||
# System-wide (replace --user with no flag, prepend sudo):
|
||||
# sudo cp systemd/*.service systemd/*.timer /etc/systemd/system/
|
||||
@@ -37,44 +38,44 @@
|
||||
# -----------------------------------------------------------------------------
|
||||
#
|
||||
# You run / schedule:
|
||||
# daily_sunrise_video.sh — daily at 09:00 (via systemd)
|
||||
# grabs today's sunrise images, makes a 10-second
|
||||
# video, uploads it to Mattermost
|
||||
# daily_sunrise_video.sh — daily at SCHEDULE_SUNRISE (via systemd, SUNRISE_CAM only)
|
||||
# grabs images around sunrise, makes a short video,
|
||||
# uploads it to Mattermost
|
||||
#
|
||||
# 4-seasons.sh — daily at 01:00 (via systemd)
|
||||
# makes yesterday's daily clip sized to its share
|
||||
# of the matching Vivaldi movement's music duration;
|
||||
# on the last day of a movement, auto-triggers
|
||||
# montage-mvt.sh
|
||||
# 4-seasons.sh <cam> — daily at SCHEDULE_SEASONS_<cam> (via systemd, per camera)
|
||||
# makes yesterday's daily clip sized to its share
|
||||
# of the matching Vivaldi movement's music duration;
|
||||
# on the last day of a movement, auto-triggers
|
||||
# montage-mvt.sh
|
||||
#
|
||||
# fullday-video.sh — daily at 02:00 (via systemd)
|
||||
# full-day timelapse at fixed fps; deletes files
|
||||
# older than 10 days automatically
|
||||
# fullday-video.sh <cam> — daily at SCHEDULE_FULLDAY_<cam> (via systemd, per camera)
|
||||
# full-day timelapse at fixed fps; deletes videos
|
||||
# older than RETENTION_DAYS automatically
|
||||
#
|
||||
# install.sh — run once at setup, and again if this file changes
|
||||
# generates and installs systemd units from conf
|
||||
# install.sh — run once at setup, and again if this file changes
|
||||
# generates and installs systemd units from conf
|
||||
#
|
||||
# stitch-cameras.py — run manually when needed
|
||||
# stitches north + sunrise into a panorama
|
||||
# usage: python3 stitch-cameras.py north.jpg sunrise.jpg prefix [focal]
|
||||
# stitch-cameras.py — run manually when needed
|
||||
# stitches north + sunrise into a panorama
|
||||
# usage: python3 stitch-cameras.py north.jpg sunrise.jpg prefix [focal]
|
||||
#
|
||||
# Auto-triggered (do not run directly):
|
||||
# montage-mvt.sh — called by 4-seasons.sh on last day of each movement
|
||||
# concatenates all daily clips for the movement,
|
||||
# speed-adjusts to match music, overlays attribution,
|
||||
# sends completion notification; on last Autumn
|
||||
# movement also triggers year-end-join.sh
|
||||
# montage-mvt.sh — called by 4-seasons.sh on last day of each movement
|
||||
# concatenates all daily clips for the movement,
|
||||
# speed-adjusts to match music, overlays attribution,
|
||||
# sends completion notification; on last Autumn
|
||||
# movement also triggers year-end-join.sh
|
||||
#
|
||||
# year-end-join.sh — called by montage-mvt.sh at end of Autumn Mvt 3
|
||||
# concatenates all 12 movement montages into one
|
||||
# Four Seasons year video, sends notification
|
||||
# year-end-join.sh — called by montage-mvt.sh at end of Autumn Mvt 3
|
||||
# concatenates all 12 movement montages into one
|
||||
# Four Seasons year video, sends notification
|
||||
#
|
||||
# Helpers (called by the scripts above, not run directly):
|
||||
# notify.sh — sends notifications via ntfy / email / Mattermost
|
||||
# season_info.py — outputs astronomical season/movement/year for a date
|
||||
# sunrise.py — outputs today's sunrise time (used by daily_sunrise_video)
|
||||
# sunrise2mm.py — uploads the sunrise video to Mattermost
|
||||
# sunrise_overlay.py — burns a timestamp overlay onto the sunrise video
|
||||
# notify.sh — sends notifications via ntfy / email / Mattermost
|
||||
# season_info.py — outputs astronomical season/movement/year for a date
|
||||
# sunrise.py — outputs today's sunrise time (used by daily_sunrise_video)
|
||||
# sunrise2mm.py — uploads the sunrise video to Mattermost
|
||||
# sunrise_overlay.py — burns a timestamp overlay onto the sunrise video
|
||||
#
|
||||
# -----------------------------------------------------------------------------
|
||||
# FILE DEPENDENCIES — who calls whom, and what to update if you rename a file
|
||||
@@ -92,20 +93,20 @@
|
||||
# and sky-cam-notify-failure@.service
|
||||
#
|
||||
# daily_sunrise_video.sh
|
||||
# ← called by systemd sky-cam-sunrise.timer (09:00)
|
||||
# → if renamed: update install.sh (write_service call, line ~80)
|
||||
# ← called by systemd sky-cam-sunrise.timer (SCHEDULE_SUNRISE)
|
||||
# → if renamed: update install.sh (write_service call ~line 70)
|
||||
# then re-run install.sh to regenerate the unit
|
||||
# calls → sunrise.py, sunrise_overlay.py, sunrise2mm.py
|
||||
#
|
||||
# 4-seasons.sh
|
||||
# ← called by systemd sky-cam-4seasons.timer (01:00)
|
||||
# → if renamed: update install.sh (write_service call, line ~86)
|
||||
# ← called by systemd sky-cam-seasons-<cam>.timer (SCHEDULE_SEASONS_<cam>)
|
||||
# → if renamed: update install.sh (write_service call ~line 85)
|
||||
# then re-run install.sh
|
||||
# calls → season_info.py, montage-mvt.sh
|
||||
#
|
||||
# fullday-video.sh
|
||||
# ← called by systemd sky-cam-fullday.timer (02:00)
|
||||
# → if renamed: update install.sh (write_service call, line ~93)
|
||||
# ← called by systemd sky-cam-fullday-<cam>.timer (SCHEDULE_FULLDAY_<cam>)
|
||||
# → if renamed: update install.sh (write_service call ~line 93)
|
||||
# then re-run install.sh
|
||||
#
|
||||
# montage-mvt.sh
|
||||
@@ -149,10 +150,6 @@
|
||||
# Full path to the directory containing this file and all the scripts.
|
||||
SCRIPT_DIR=/home/motion/drives/local-2tb/sunrise-scripts
|
||||
|
||||
# Camera name — subfolder under BASE_DIR (images) and BASE_DIR/movies (videos).
|
||||
# E.g. "sunrise" → images: $BASE_DIR/sunrise/YYYY-MM-DD/ videos: $BASE_DIR/movies/sunrise/
|
||||
CAM_NAME=sunrise
|
||||
|
||||
# ── Storage ───────────────────────────────────────────────────────────────────
|
||||
BASE_DIR=/home/motion/drives/local-2tb
|
||||
MUSIC_DIR=/home/motion/drives/local-2tb/music/4 Seasons
|
||||
@@ -160,10 +157,38 @@ MUSIC_DIR=/home/motion/drives/local-2tb/music/4 Seasons
|
||||
# ── Location & timezone ───────────────────────────────────────────────────────
|
||||
# Used by sunrise.py to calculate sunrise time each day.
|
||||
# TIMEZONE must be a valid IANA name: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
|
||||
LATITUDE=38.123456
|
||||
LONGITUDE=-97.654321
|
||||
LATITUDE=25.0000
|
||||
LONGITUDE=-38.0000
|
||||
TIMEZONE=America/New_York
|
||||
|
||||
# ── Cameras ───────────────────────────────────────────────────────────────────
|
||||
# List every camera name here (space-separated inside the parentheses).
|
||||
# Each name becomes a subfolder under BASE_DIR (images) and BASE_DIR/movies.
|
||||
# To add a camera: add its name here, add its schedules below, re-run install.sh.
|
||||
#
|
||||
CAMERAS=(sunrise) # e.g. CAMERAS=(sunrise north west)
|
||||
SUNRISE_CAM=sunrise # which camera faces east (gets the sunrise video job)
|
||||
|
||||
# ── Schedules ─────────────────────────────────────────────────────────────────
|
||||
# SCHEDULE_SUNRISE when to run daily_sunrise_video.sh (SUNRISE_CAM only)
|
||||
# SCHEDULE_SEASONS_<cam> when to run 4-seasons.sh for each camera
|
||||
# SCHEDULE_FULLDAY_<cam> when to run fullday-video.sh for each camera
|
||||
#
|
||||
# Times are HH:MM:SS (24-hour). Space cameras at least 30 min apart.
|
||||
# install.sh reads these and generates one systemd timer per camera per job.
|
||||
#
|
||||
SCHEDULE_SUNRISE=09:00:00
|
||||
|
||||
SCHEDULE_SEASONS_sunrise=01:00:00
|
||||
SCHEDULE_FULLDAY_sunrise=02:00:00
|
||||
|
||||
# Uncomment and fill in for each camera you add to CAMERAS above:
|
||||
#SCHEDULE_SEASONS_north=01:30:00
|
||||
#SCHEDULE_FULLDAY_north=02:30:00
|
||||
#
|
||||
#SCHEDULE_SEASONS_west=02:00:00
|
||||
#SCHEDULE_FULLDAY_west=03:00:00
|
||||
|
||||
# ── Sunrise video tuning ──────────────────────────────────────────────────────
|
||||
# How many minutes before/after sunrise to include in the daily clip.
|
||||
SUNRISE_PRE_MIN=70
|
||||
@@ -181,23 +206,23 @@ access_token=your-access-token-here
|
||||
channel_id=your-daily-upload-channel-id-here
|
||||
|
||||
# ── Notifications — montage / year-end complete + any job failure ─────────────
|
||||
# Notifications fire when a movement montage or the year video finishes.
|
||||
# They also fire automatically via systemd OnFailure= if any daily job fails.
|
||||
# Enable one or more methods below.
|
||||
# Notifications fire when a movement montage or the year video finishes,
|
||||
# and via systemd OnFailure= if any daily job fails.
|
||||
# Uncomment and configure one or more methods to enable.
|
||||
|
||||
# ntfy — push notifications, zero signup required for self-hosted:
|
||||
# https://docs.ntfy.sh/install/
|
||||
# or use the free cloud tier at ntfy.sh (pick any topic name)
|
||||
NTFY_ENABLED=false
|
||||
NTFY_URL=https://ntfy.sh/your-topic-here
|
||||
# ntfy — push notifications, zero signup for self-hosted or free cloud tier:
|
||||
# Self-hosted: https://docs.ntfy.sh/install/
|
||||
# Cloud: pick any topic name at ntfy.sh (no account needed)
|
||||
#NTFY_ENABLED=true
|
||||
#NTFY_URL=https://ntfy.sh/your-topic-here
|
||||
|
||||
# Email — requires the 'mail' command on the system (package: mailutils or s-nail).
|
||||
# For outbound SMTP configure /etc/ssmtp/ssmtp.conf or msmtp.
|
||||
EMAIL_ENABLED=false
|
||||
EMAIL_TO=you@example.com
|
||||
EMAIL_FROM=skycam@localhost
|
||||
# Email — requires the 'mail' command (package: mailutils or s-nail).
|
||||
# Configure outbound SMTP via /etc/ssmtp/ssmtp.conf or msmtp.
|
||||
#EMAIL_ENABLED=true
|
||||
#EMAIL_TO=you@example.com
|
||||
#EMAIL_FROM=skycam@localhost
|
||||
|
||||
# Mattermost text post — reuses the URL and token above, but posts to this
|
||||
# channel (can be the same daily channel or a separate private/admin channel).
|
||||
MM_NOTIFY_ENABLED=false
|
||||
MM_NOTIFY_CHANNEL_ID=your-notify-channel-id-here
|
||||
# Mattermost text post — reuses mattermost_url and access_token above.
|
||||
# Can be the same daily channel or a separate admin/private channel.
|
||||
#MM_NOTIFY_ENABLED=true
|
||||
#MM_NOTIFY_CHANNEL_ID=your-notify-channel-id-here
|
||||
|
||||
Reference in New Issue
Block a user