#!/bin/bash # -------------------------------------------------------------------------- # Setup Host-Level Crontab for Intaleq Map Platform # -------------------------------------------------------------------------- set -e echo "Setting up crontab for map-saas..." CRON_FILE="/tmp/map_saas_cron" # 1. Update Map Data (OSM/Overture) every 10 days at 3:00 AM echo "0 3 */10 * * /home/hamzadoctor/app/infrastructure/scripts/update-data.sh >> /home/hamzadoctor/app/infrastructure/logs/update-data.log 2>&1" > $CRON_FILE # 2. Discover road closures daily at 4:00 AM echo "0 4 * * * curl -X POST -H \"x-api-key: intaleq_secret_2026\" http://localhost:3200/api/map-refinement/roads/discover-closures >> /home/hamzadoctor/app/infrastructure/logs/closures.log 2>&1" >> $CRON_FILE # 3. Check for manual routing sync requests every minute echo "* * * * * /home/hamzadoctor/app/infrastructure/scripts/check_routing_sync.sh >> /home/hamzadoctor/app/infrastructure/logs/routing_sync.log 2>&1" >> $CRON_FILE # 4. Update Overture Maps Data on the 1st of every month at 2:00 AM echo "0 2 1 * * /home/hamzadoctor/app/infrastructure/scripts/overture_ingest.sh >> /home/hamzadoctor/app/infrastructure/logs/overture_ingest.log 2>&1" >> $CRON_FILE # Install crontab crontab $CRON_FILE rm $CRON_FILE echo "✅ Crontab installed successfully!" crontab -l