# ============================================================
# CarWash POS — cPanel Cron Jobs
# Add these in cPanel → Cron Jobs
# Replace /home/USERNAME/public_html with your actual path
# ============================================================

# Process queued jobs every minute (SMS, emails, PDF receipts)
* * * * * /usr/local/bin/php /home/USERNAME/public_html/artisan queue:work --stop-when-empty --tries=3 --timeout=60 >> /dev/null 2>&1

# Send scheduled marketing campaigns (every 15 minutes)
*/15 * * * * /usr/local/bin/php /home/USERNAME/public_html/artisan schedule:run >> /dev/null 2>&1

# Clean up old receipts (daily at 2am)
0 2 * * * /usr/local/bin/php /home/USERNAME/public_html/artisan receipts:cleanup >> /dev/null 2>&1

# Database backup (daily at 3am)
0 3 * * * /usr/local/bin/php /home/USERNAME/public_html/artisan db:backup >> /dev/null 2>&1

# ============================================================
# NOTES:
# - queue:work --stop-when-empty is safe for shared hosting
#   (starts, processes all pending jobs, then exits cleanly)
# - If php path differs, find it with: which php
#   Common paths: /usr/bin/php, /usr/local/bin/php8.2
# ============================================================
