Files
flight-monitor/cron-install.sh
Otis 97ec0e5eec feat: flight price monitor with Kiwi adapter stub and cron setup
- config.json: BER→EZE route, €700 threshold, 14-28 nights, Dec-Mar preferred
- monitor.py: config-driven, multi-route, windowed date search, openclaw alerts
- adapters/base.py: abstract FlightAdapter interface
- adapters/kiwi.py: Kiwi/Tequila v2 adapter (stub until KIWI_API_KEY is set)
- requirements.txt, cron-install.sh (daily 08:00 UTC), README.md
2026-03-19 07:52:54 +00:00

23 lines
756 B
Bash
Executable File

#!/usr/bin/env bash
# Install a daily cron job to run the flight monitor at 08:00 UTC.
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
PYTHON="$(command -v python3 || command -v python)"
CRON_CMD="0 8 * * * $PYTHON $SCRIPT_DIR/monitor.py >> $SCRIPT_DIR/monitor.log 2>&1"
MARKER="flight-monitor"
# Check if already installed
if crontab -l 2>/dev/null | grep -q "$MARKER"; then
echo "✅ Cron job already installed (contains '$MARKER'). Nothing changed."
exit 0
fi
# Append new entry (preserve existing crontab)
(crontab -l 2>/dev/null || true; echo "# $MARKER"; echo "$CRON_CMD") | crontab -
echo "✅ Cron job installed:"
echo " $CRON_CMD"
echo ""
echo "Runs daily at 08:00 UTC. Logs → $SCRIPT_DIR/monitor.log"