All paths into sky-cam.conf; install.sh generates systemd units

sky-cam.conf
- Add SCRIPT_DIR (install location) and CAM_NAME (camera/folder name)
- These are the only values that change when deploying to a new machine

install.sh (new)
- Sources sky-cam.conf, generates all systemd .service and .timer units
  with correct ExecStart paths, then enables and starts the timers
- Run once after editing sky-cam.conf; run again if paths change
- Supports --system flag for system-wide install

All .sh scripts + sunrise2mm.py
- No hardcoded paths remain
- script_name=$(basename ...) derivation replaced by $CAM_NAME from conf
- sunrise_video.10s.sh now sources sky-cam.conf for BASE_DIR, CAM_NAME,
  and SCRIPT_DIR (replaces all /home/motion/... references)
- sunrise2mm.py builds video path from BASE_DIR + CAM_NAME in conf

systemd/ template files kept as reference but no longer need editing

https://claude.ai/code/session_01C4jbd3waXG3eKZYbGUjLUQ
This commit is contained in:
Claude
2026-04-18 21:31:26 +00:00
parent ac01c05948
commit 5d3ee97df0
8 changed files with 151 additions and 33 deletions
+2 -2
View File
@@ -45,8 +45,8 @@ today_date_str = today.strftime("%Y-%m-%d") # e.g., "2024-11-05"
today_month_str = today.strftime("%Y-%m") # e.g., "2024-11"
# Set the full folder path for today's video
base_video_folder = "/home/motion/drives/local-2tb/movies/sunrise" # Correct base folder for videos
output_dir = os.path.join(base_video_folder, today_month_str, "sunrise-only") # Subfolder for final videos
base_video_folder = os.path.join(config.get('BASE_DIR', ''), 'movies', config.get('CAM_NAME', 'sunrise'))
output_dir = os.path.join(base_video_folder, today_month_str, "sunrise-only")
# Check if the directory exists
if not os.path.isdir(output_dir):