# ============================================================================== # 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. OSM roads, regional places, and source-backed gates every 10 days at 03:00 # - Uses MAP_DATA_SCOPE to select core, GCC, or GCC + Yemen coverage # - Reads actual entrance/gate nodes from the merged OSM PBF # ------------------------------------------------------------------------------ 0 3 */10 * * /bin/bash /home/hamzadoctor/app/infrastructure/scripts/update-data.sh >> /home/hamzadoctor/app/infrastructure/logs/update-data.log 2>&1 # ------------------------------------------------------------------------------ # 2. Bi-monthly supplemental place enrichment (1st and 15th at 07:00 AM) # - Enriches Iraq and Egypt place tables; gate data is handled above # ------------------------------------------------------------------------------ 0 7 1,15 * * /bin/bash /home/hamzadoctor/app/scripts/master_cron_sync.sh >> /home/hamzadoctor/app/logs/cron_places_sync.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