# EventHeOdds Automated Data Sync Crontab # All times are in server time (UTC) # Install with: crontab /var/www/html/eventheodds/config/crontab.txt # # EST Reference: UTC-5 (winter) / UTC-4 (summer) # Games typically: 7 PM - 11 PM EST = 00:00 - 04:00 UTC (next day) SHELL=/bin/bash PATH=/usr/local/bin:/usr/bin:/bin MAILTO="" # ============================================================ # CORE DATA SYNC (Every 30 minutes during active hours) # ============================================================ # Covers: SGO SDK sync, props normalization, canonical linking # Active hours: 10 AM - 2 AM EST = 15:00 - 07:00 UTC */30 15-23,0-7 * * * cd /var/www/html/eventheodds && /bin/bash scripts/cron-master-sync.sh >> /var/log/eventheodds/cron-master.log 2>&1 # ============================================================ # FULL CANONICAL SYNC (Daily at 4 AM UTC / 11 PM EST) # ============================================================ # Deep linking, abbreviated names, NHL fixes, full coverage report 0 4 * * * cd /var/www/html/eventheodds && /bin/bash scripts/cron-sync-canonical-full.sh >> /var/log/eventheodds/cron-canonical.log 2>&1 # ============================================================ # ESPN METRICS SYNC (Every 2 hours) # ============================================================ # Player game stats from ESPN for all leagues 0 */2 * * * cd /var/www/html/eventheodds && /bin/bash scripts/cron-sync-espn-all.sh >> /var/log/eventheodds/cron-espn.log 2>&1 # ============================================================ # ROSTER/PLAYER SYNC (Daily at 8 AM UTC / 3 AM EST) # ============================================================ # Refresh rosters and player data 0 8 * * * cd /var/www/html/eventheodds && /bin/bash scripts/cron-sync-canonical-rosters.sh >> /var/log/eventheodds/cron-rosters.log 2>&1 # ============================================================ # ODDS SNAPSHOTS (Every 15 minutes during game windows) # ============================================================ # Capture live odds for CLV analysis # Game windows: 12 PM - 1 AM EST = 17:00 - 06:00 UTC */15 17-23,0-6 * * * cd /var/www/html/eventheodds && /bin/bash scripts/cron-odds-snapshots.sh >> /var/log/eventheodds/cron-odds.log 2>&1 # ============================================================ # ANALYTICS COMPUTATION (Daily at 6 AM UTC / 1 AM EST) # ============================================================ # Compute derived analytics, CLV, market efficiency, etc. 0 6 * * * cd /var/www/html/eventheodds && /bin/bash scripts/cron-compute-analytics.sh >> /var/log/eventheodds/cron-analytics.log 2>&1 # ============================================================ # INJURY SYNC (Every 4 hours) # ============================================================ 0 */4 * * * cd /var/www/html/eventheodds && /bin/bash scripts/cron-sync-injuries.sh >> /var/log/eventheodds/cron-injuries.log 2>&1 # ============================================================ # SCHEDULE INGESTION (Daily at 5 AM UTC) # ============================================================ # Fetch upcoming game schedules 0 5 * * * cd /var/www/html/eventheodds && /bin/bash scripts/cron-ingest-schedules.sh >> /var/log/eventheodds/cron-schedules.log 2>&1 # ============================================================ # LOG ROTATION (Daily at 3 AM UTC) # ============================================================ 0 3 * * * find /var/log/eventheodds -name "*.log" -mtime +7 -exec gzip {} \; 2>/dev/null 0 3 * * * find /var/log/eventheodds -name "*.gz" -mtime +30 -delete 2>/dev/null # ============================================================ # HEALTH CHECK (Every 5 minutes) # ============================================================ */5 * * * * curl -sf http://localhost:3000/api/health > /dev/null || (pm2 restart eventheodds-web && echo "[$(date)] Restarted eventheodds-web" >> /var/log/eventheodds/health.log)