DocsComputeCron Jobs

Cron Jobs

A scheduled job is a command that runs automatically inside your service container at a given time — a convenient way to keep an application maintained without external scripts or servers.

Typical scenarios#

  • Clearing temporary files and caches.
  • Sending notifications and digests.
  • Importing and syncing data with external systems.
  • Recomputing reports and aggregates.
  • Regular framework commands (schedulers, queue workers).

Creating a job#

  1. 1
    Open the Schedules tab
    Open the service → Schedules. The list shows every job: name, schedule, command, state and last run time.
  2. 2
    Fill in the form
    Click Add job and complete the fields described below, then press Save — the job is created already enabled.
  3. 3
    Test it manually
    Don't wait for the schedule: press Run now. A "job started manually" notification appears and the output shows up on the service Logs tab.

Form fields

FieldDescription
NameA short name to recognise the job by, e.g. cleanup-temp or daily-report.
Schedule (cron)A preset — every 5 minutes, hourly, every 6 hours, daily at 00:00, weekly (Sunday), monthly (1st) — or your own expression.
ShellThe interpreter running the command: bash by default, or sh for minimal images without bash.
CommandThe line executed inside the container, in the app working directory and with all its environment variables.

The cron format has five fields: minute hour day month weekday.

ExpressionWhen it runs
*/5 * * * *every 5 minutes
0 * * * *at the start of every hour
0 4 * * *every day at 04:00
15 2 * * 1-5on weekdays at 02:15
0 0 1 * *at midnight on the 1st of each month

Command examples

bash
php artisan schedule:run
node scripts/cleanup.js
find /data/tmp -type f -mtime +7 -delete

Managing jobs#

FieldDescription
ToggleTemporarily disable a job without deleting it.
Run nowRun the command outside the schedule.
EditChange the name, schedule, shell or command.
DeleteRemove the job permanently.

Important behaviour#

  • Jobs run inside a running container. If the service is stopped, nothing runs.
  • Schedule times are in UTC — mind the offset from your timezone.
  • A job must not run longer than the interval between runs, otherwise runs start overlapping.
  • Move long, heavy operations into a dedicated worker service.
  • Output goes into the service logs — print clear messages so failures are easy to read.
Scheduled jobs vs Cron services
A scheduled job runs a command inside an existing service. A cron service is a separate container that starts on schedule and exits.

FAQ#

Why didn't my job run?

Check that the service is running, the job is enabled and the schedule is in UTC. Then look at the Logs tab — the command may have failed.

How do I know the command succeeded?

Press Run now and open Logs right away: you'll see the output and the exit code.

Can I schedule jobs for a database?

Scheduled jobs are available for applications and stacks. To save database data regularly, use backups.