46 lines
2.9 KiB
Plaintext
46 lines
2.9 KiB
Plaintext
# ==============================================================================
|
|
# SIRO Maps — Sovereign Geospatial Platform Crontab Schedule
|
|
# ==============================================================================
|
|
# Base Directory: /home/hamzadoctor/app
|
|
# Environment: Production
|
|
# ==============================================================================
|
|
SHELL=/bin/bash
|
|
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
|
|
APP_DIR=/home/hamzadoctor/app
|
|
|
|
# ------------------------------------------------------------------------------
|
|
# 1. Bi-Monthly Geospatial Synchronization (Every 1st & 15th at 03:00 AM)
|
|
# - Syncs OSM & Overture places for Jordan, Iraq, Egypt, Syria
|
|
# - Generates and classifies Gates & Entrances (Hospitals, Malls, Unis, Hotels, Parks)
|
|
# - Refreshes Materialized View (unified_search_index) concurrently
|
|
# - Flushes Redis search cache
|
|
# ------------------------------------------------------------------------------
|
|
0 3 1,15 * * /bin/bash /home/hamzadoctor/app/scripts/master_cron_sync.sh >> /home/hamzadoctor/app/logs/cron_places_sync.log 2>&1
|
|
|
|
# ------------------------------------------------------------------------------
|
|
# 2. Road Network & Routing Update (Every 10 days at 01:00 AM)
|
|
# - Downloads fresh OSM PBF for Jordan & Syria
|
|
# - Rebuilds GraphHopper routing index & clears traffic cache
|
|
# ------------------------------------------------------------------------------
|
|
0 1 1,10,20 * * /bin/bash /home/hamzadoctor/app/scripts/update-data.sh >> /home/hamzadoctor/app/logs/cron_osm_update.log 2>&1
|
|
|
|
# ------------------------------------------------------------------------------
|
|
# 3. Daily Database Backup (Every Day at 02:00 AM)
|
|
# - Exports custom places, place_gates, billing, users & telemetry tables
|
|
# - Retains backups for 7 days
|
|
# ------------------------------------------------------------------------------
|
|
0 2 * * * /bin/bash /home/hamzadoctor/app/scripts/backup_db.sh >> /home/hamzadoctor/app/logs/cron_backup.log 2>&1
|
|
|
|
# ------------------------------------------------------------------------------
|
|
# 4. Weekly PostgreSQL Optimization (Every Sunday at 04:00 AM)
|
|
# - Runs VACUUM ANALYZE across heavy spatial tables and indexes
|
|
# ------------------------------------------------------------------------------
|
|
0 4 * * 0 docker compose -f /home/hamzadoctor/app/docker-compose.yml exec -T db vacuumdb -U mapuser -d mapdb --analyze-in-stages >> /home/hamzadoctor/app/logs/cron_vacuum.log 2>&1
|
|
|
|
# ------------------------------------------------------------------------------
|
|
# 5. Weekly Log Rotation & Docker Maintenance (Every Sunday at 05:00 AM)
|
|
# - Truncates logs > 50MB and removes logs older than 14 days
|
|
# - Prunes dangling Docker images and builder caches
|
|
# ------------------------------------------------------------------------------
|
|
0 5 * * 0 /bin/bash /home/hamzadoctor/app/scripts/cleanup_logs.sh >> /home/hamzadoctor/app/logs/cron_cleanup.log 2>&1
|