#!/bin/bash
# Sudanna v23.2 — Cron Jobs
# Add ALL these in cPanel → Cron Jobs
# Path: /home/saiadmin/public_html/s26

PHP=/usr/local/bin/php
ROOT=/home/saiadmin/public_html/s26
LOG=/home/saiadmin/logs

# Create logs directory if missing
mkdir -p $LOG

# === CRON 1: Main Worker (every minute - REQUIRED) ===
# * * * * * /usr/local/bin/php /home/saiadmin/public_html/cron/worker.php >> /home/saiadmin/logs/worker.log 2>&1

# === CRON 2: KPI Aggregation (every hour) ===
# 0 * * * * /usr/local/bin/php /home/saiadmin/public_html/cron/kpi_aggregate.php >> /home/saiadmin/logs/kpi.log 2>&1

# === CRON 3: Booking Cleanup (daily at 2am) ===
# 0 2 * * * /usr/local/bin/php /home/saiadmin/public_html/cron/booking_cleanup.php >> /home/saiadmin/logs/booking.log 2>&1

# === CRON 4: Cache Cleanup (daily at 3am) ===
# 0 3 * * * /usr/local/bin/php /home/saiadmin/public_html/cron/cache_cleanup.php >> /home/saiadmin/logs/cache.log 2>&1

echo "Cron reference file — add each line to cPanel Cron Jobs"
