Feature · Scale & data

Run cron jobs without a server.

A cron job is a command that runs automatically on a schedule. On Runex, you give a command and a cron expression, and Runex runs it in an isolated container at the right time, with logs for every run and no server left on in between.

  • Standard cron expressions
  • A container per run
  • Logs for every execution
cron · nightly-report
schedule
0 2 * * *
command
npm run report
last run
succeeded
next run
tomorrow 02:00
logs
captured
cron jobsrunex

Definition

What is a cron job?

A cron job is a scheduled task: a command that runs at fixed times, dates, or intervals.

The name comes from cron, the Unix scheduler. Schedules use a five-field cron expression: minute, hour, day of month, month, and day of week.

Traditionally you add a line to a crontab on a server that has to stay on. On Runex, each run starts its own container from your code, runs the command, and exits.

Use cron jobs for work on a clock: reports, cleanups, syncs. For work triggered by users, a background queue is the better fit.

How it works

How do cron jobs work on Runex?

Command plus schedule. That's it.

  1. You

    Pick a command

    Any script in your repo, like npm run report.

  2. You

    Set a schedule

    A cron expression, such as 0 2 * * *.

  3. Runex

    Run on time

    A container starts, runs it, and exits.

  4. Runex

    Log every run

    Output and exit status are kept.

Benefits

Why run cron jobs on Runex?

Scheduled work that doesn't depend on one machine staying up.

No always-on server

Containers exist only while the job runs.

Same code, same env vars

Jobs use your repo and configuration.

Logs for every run

See output and failures per execution.

Isolated runs

A job can't starve your web app of resources.

Compare

Cron job vs background worker: what's the difference?

Cron runs on a clock; a worker runs on demand.

Cron job vs background worker: what's the difference?
Cron jobBackground worker
TriggerA schedule, like every night at 2:00Jobs added to a queue
LifecycleStarts, finishes, exitsAlways running, waiting for work
ExampleNightly sales reportWelcome email after signup
Best forPeriodic maintenanceUser-triggered tasks

Example

Example: a nightly sales report

A store emails yesterday's sales to the team every morning, with no server running overnight.

  1. Add scripts/report.js to the repo
  2. Create a cron job with 0 2 * * *
  3. Set the command to node scripts/report.js
  4. At 02:00, Runex starts a container and runs it
  5. The report is emailed and the container exits
  6. Run output is saved in the job's logs
cron-jobs
job
sales-report
schedule
0 2 * * * · daily
runtime
container per run
exit code
0
result
report sent
illustrative namesrunex

FAQ

Questions developers ask

Short answers about cron jobs. More in the documentation.

How do I write a cron expression?

Use five fields: minute, hour, day of month, month, day of week. For example, 0 2 * * * runs at 2:00 every day, and */15 * * * * runs every 15 minutes. Runex uses this standard five-field format for scheduled jobs.

What does * * * * * mean in cron?

Every minute. Each asterisk means “every” value for that field.

What time zone do cron jobs use?

It depends on the platform, and many use UTC. Check the time zone shown for your schedule and convert your local time before saving it.

What happens if a cron job fails?

The run is marked failed and its output is kept in the logs. Fix the script, and the next scheduled run picks up the change.

Next step

Ship with cron jobs today.

Sign up, install the GitHub App, and deploy your first app. It's free to start.