Fix executable bits and add camera name to 4-seasons notifications
- chmod +x all *.sh and *.py in install.sh so permissions survive git checkouts - Fix daily_sunrise_video.sh and Python scripts missing executable bit - Add [CAM_NAME] prefix to all 4-seasons.sh notify.sh calls so multi-camera setups show which camera each daily clip came from - Include camera name in output filename: YYYY-MM-DD_<cam>_MvtN-DayXofY-final.mp4 https://claude.ai/code/session_01C4jbd3waXG3eKZYbGUjLUQ
This commit is contained in:
+4
-4
@@ -106,7 +106,7 @@ echo "Raw duration: $raw_duration s"
|
||||
speed_factor=$(echo "scale=6; $raw_duration / $target_per_clip" | bc)
|
||||
echo "Step 2/2: speed factor $speed_factor..."
|
||||
|
||||
final_file="$output_dir/${yesterday}_Mvt${MVT_NUM}-Day${DAY_OF_MVT}of${DAYS_IN_MVT}-final.mp4"
|
||||
final_file="$output_dir/${yesterday}_${CAM_NAME}_Mvt${MVT_NUM}-Day${DAY_OF_MVT}of${DAYS_IN_MVT}-final.mp4"
|
||||
if ! ffmpeg -loglevel warning \
|
||||
-i "$temp_video" \
|
||||
-vf "setpts=PTS/$speed_factor,fps=25" \
|
||||
@@ -114,7 +114,7 @@ if ! ffmpeg -loglevel warning \
|
||||
-t "$target_per_clip" -an \
|
||||
-y "$final_file"; then
|
||||
rm -f "$final_file"
|
||||
"$SCRIPT_DIR/notify.sh" "FAILED: $SEASON Mvt$MVT_NUM Day$DAY_OF_MVT speed-adjust ($yesterday)" \
|
||||
"$SCRIPT_DIR/notify.sh" "FAILED: [$CAM_NAME] $SEASON Mvt$MVT_NUM Day$DAY_OF_MVT speed-adjust ($yesterday)" \
|
||||
"ffmpeg speed-adjust failed — re-run 4-seasons.sh $CAM_NAME while JPGs exist" || true
|
||||
exit 1
|
||||
fi
|
||||
@@ -126,11 +126,11 @@ echo "Daily clip: $final_file ($adjusted s)"
|
||||
drift=$(echo "scale=3; $adjusted - $target_per_clip" | bc | sed 's/^-//')
|
||||
if awk "BEGIN{exit !($drift > 0.5)}"; then
|
||||
echo "WARNING: clip duration ${adjusted}s differs from target ${target_per_clip}s by ${drift}s"
|
||||
"$SCRIPT_DIR/notify.sh" "WARNING: $SEASON Mvt$MVT_NUM Day$DAY_OF_MVT duration drift ($yesterday)" \
|
||||
"$SCRIPT_DIR/notify.sh" "WARNING: [$CAM_NAME] $SEASON Mvt$MVT_NUM Day$DAY_OF_MVT duration drift ($yesterday)" \
|
||||
"Clip ${adjusted}s vs target ${target_per_clip}s (drift ${drift}s)" || true
|
||||
fi
|
||||
|
||||
"$SCRIPT_DIR/notify.sh" "$SEASON Mvt$MVT_NUM Day$DAY_OF_MVT/$DAYS_IN_MVT saved ($yesterday)" \
|
||||
"$SCRIPT_DIR/notify.sh" "[$CAM_NAME] $SEASON Mvt$MVT_NUM Day$DAY_OF_MVT/$DAYS_IN_MVT saved ($yesterday)" \
|
||||
"$(basename "$final_file") — ${adjusted}s" || true
|
||||
|
||||
# ── Auto-trigger montage on last day of movement ──────────────────────────────
|
||||
|
||||
Regular → Executable
Regular → Executable
@@ -29,6 +29,9 @@ fi
|
||||
mkdir -p "$UNIT_DIR"
|
||||
echo "Installing systemd units to $UNIT_DIR ..."
|
||||
|
||||
# ── Ensure all scripts are executable ────────────────────────────────────────
|
||||
chmod +x "$HERE"/*.sh "$HERE"/*.py 2>/dev/null || true
|
||||
|
||||
# ── Pre-create data directories for all cameras ───────────────────────────────
|
||||
echo "Creating data directories..."
|
||||
for cam in "${CAMERAS[@]}"; do
|
||||
|
||||
Regular → Executable
Regular → Executable
Regular → Executable
Reference in New Issue
Block a user