# Namecheap cPanel Cron

## Primary scheduler

Run the repository Cron bridge every 5 minutes from cPanel:

```text
*/5 * * * * /PATH/TO/NODE /home/CPANEL_USER/invest-app/scripts/cpanel-cron.mjs >> /home/CPANEL_USER/logs/invest-cron.log 2>&1
```

Do not copy the example path blindly. Use the actual Node binary and Application Root shown by cPanel.

Required environment variables on the Node application:

- `APP_BASE_URL=https://invest.azcodehost.com`
- `CRON_SECRET=<stored in cPanel environment settings>`
- `DATABASE_URL=<stored in cPanel environment settings>`

The script calls `POST /api/internal/cron/run` with a bearer secret. The secret must not be placed in the URL or committed to Git.

## Cron tasks

The current runner performs bounded database work suitable for shared hosting. Heavy/long-running export jobs should remain limited and move to a VPS worker if they outgrow cPanel limits.

## Timezone

Server Cron time may differ from Baghdad local time. Business dates are stored explicitly and application-facing time should use `Asia/Baghdad` where needed rather than assuming the server timezone.
