# Payroll Cron Setup

The payroll scheduler should run regularly so pay cycles are processed on time.
Add a cron entry that runs the new `schedule_payroll.php` script each day.

```cron
# Check for payrolls that need processing at 1AM daily
0 1 * * * /usr/bin/php /path/to/api/jobs/schedule_payroll.php >> /var/log/payroll_schedule.log 2>&1
```

The script examines `pay_cycles.next_run_date` and queues any due payroll runs.
Each run is processed in the background by `payroll_worker.php`.
