# Cron Jobs Setup Guide

## Linux/Mac (crontab)

Edit crontab:
```bash
crontab -e
```

Add these lines:
```bash
# Process email queue every 5 minutes
*/5 * * * * php /var/www/html/hostiva/cron/process_email_queue.php >> /var/www/html/hostiva/logs/cron.log 2>&1

# Send check-in reminders daily at 9 AM
0 9 * * * php /var/www/html/hostiva/cron/send_checkin_reminders.php >> /var/www/html/hostiva/logs/cron.log 2>&1

# Send payment reminders daily at 10 AM
0 10 * * * php /var/www/html/hostiva/cron/send_payment_reminders.php >> /var/www/html/hostiva/logs/cron.log 2>&1

# Sync OTA bookings every 4 hours
0 */4 * * * php /var/www/html/hostiva/cron/sync_ota.php >> /var/www/html/hostiva/logs/cron.log 2>&1
```

## Windows (Task Scheduler)

For XAMPP on Windows, use Task Scheduler:

1. Open Task Scheduler
2. Create Basic Task
3. Set trigger (e.g., every 5 minutes)
4. Action: Start a program
5. Program: C:\xampp\php\php.exe
6. Arguments: C:\xampp\htdocs\hostiva\cron\process_email_queue.php

Repeat for each cron job.

## Testing Cron Jobs

Run manually to test:
```bash
php /var/www/html/hostiva/cron/process_email_queue.php
php /var/www/html/hostiva/cron/send_checkin_reminders.php
php /var/www/html/hostiva/cron/send_payment_reminders.php
php /var/www/html/hostiva/cron/sync_ota.php
```

## Monitoring

Check cron logs:
```bash
tail -f /var/www/html/hostiva/logs/cron.log
```
