Cron jobs
Run a command on a schedule inside your service, with its code and environment variables. Each run's output and result are kept so you can check it worked.
Add a job
Open your service, then Cron jobs, and add a name, a command and a schedule. Choose Run now to try it straight away.
Schedules
Five parts: minute, hour, day of month, month, day of week. Times are in UTC (Lagos is UTC+1).
*/15 * * * *- Every 15 minutes
0 * * * *- Every hour, on the hour
0 2 * * *- Every day at 02:00 UTC (03:00 in Lagos)
30 6 * * 1- Mondays at 06:30 UTC
0 0 1 * *- The first day of each month at midnight UTC
Each run
- The command runs in your service's current version, as its own user.
- It is stopped if it runs past its time limit, which you set between 1 and 60 minutes.
- The latest run's output, exit code and duration are shown on the job. Exit code 0 means success.
- A run is skipped while the service is stopped, and while the previous run of the same job is still going.
Cron job or scheduler worker?
If your framework has its own scheduler, such as Laravel's schedule, run it as a scheduler worker with php artisan schedule:work and keep the schedule in your code. Use cron jobs for standalone commands, or when you want to change a schedule without deploying.
Up to 10 cron jobs per service.