Cron job: plainly explained.

A cron job runs a scheduled task automatically at set times. Learn the cron syntax, common uses, cron vs webhook and best practices.

Automation · Updated Nov 7, 2026

DEFINITION

A cron job is a task scheduled to run automatically at fixed times or intervals on a server, used to automate recurring work like backups and reports.

CATEGORY

Automation

RELATED

Automation, Workflow

Summarize this page with AI

A cron job is a task scheduled to run automatically at fixed times or intervals on a server, such as every night at 2 a.m. or every Monday morning. It is the standard way to automate recurring work like backups, reports and data syncs without anyone clicking a button.

01

What is a cron job?

A cron job is a command or script that a scheduler launches on its own at a defined time. The name comes from cron, the time-based job scheduler built into Unix and Linux systems. A background service reads a list of schedules and runs each task when its moment arrives, whether or not anyone is logged in.

It matters because much of the work that keeps a product healthy is repetitive: cleaning old records, sending digests, refreshing caches, renewing certificates. Scheduling these tasks removes manual effort and the risk of forgetting them, and it makes the result consistent: the same job runs the same way every time, at a moment when traffic is usually low.

02

Cron syntax explained

Each job is a line in a file called the crontab. It starts with five time fields, followed by the command to run:

* * * * * command

  • Minute (0-59)
  • Hour (0-23)
  • Day of month (1-31)
  • Month (1-12)
  • Day of week (0-7, where 0 and 7 are Sunday)

For example, this runs a backup script every day at 02:30:

30 2 * * * /usr/local/bin/backup.sh

An asterisk means "every value", a comma lists values, a dash sets a range and a slash sets a step: */15 * * * * runs every 15 minutes.

03

Common uses of cron jobs

  • Database backups and log rotation.
  • Sending scheduled emails, reminders or weekly reports.
  • Syncing data between tools or refreshing an external feed.
  • Generating sitemaps and clearing expired cache or sessions.
  • Running health checks and alerting when a service stops responding.

Managed platforms offer the same idea without a server: Supabase, Cloudflare Workers and most cloud providers let you schedule functions on a cron expression.

04

Cron job vs webhook vs manual trigger

Trigger
Cron jobStarts whenA set time or interval is reachedBest forRecurring, predictable tasks
WebhookStarts whenAn external event sends a requestBest forReacting instantly to something that happened
Manual triggerStarts whenA person starts the taskBest forOne-off or exceptional operations

A cron job polls the calendar, a webhook waits for an event. Many automations combine both: a webhook handles the live event, and a nightly cron job reconciles anything that was missed.

05

Best practices and common pitfalls

Make each job idempotent, meaning that running it twice produces the same result as running it once, because overlaps and retries happen. Log the output and monitor success, for example with a heartbeat ping to an uptime service, since a cron job that silently fails is worse than none. Use absolute paths and set the environment explicitly, as cron runs with a minimal one.

Watch the time zone: a server in UTC will not run a task at 9 a.m. Paris time unless you account for the offset and for daylight saving. Avoid stacking heavy jobs on the same minute, and add a lock so a slow run does not overlap with the next.

Finally, document every job: what it does, who owns it and what to do when it fails. Scheduled tasks tend to be forgotten until the day they break, and an undocumented one is hard to fix under pressure.

06

Cron jobs at BeBranded

We use scheduled jobs, in code or in no-code tools like Make and n8n, to keep data synced and reports flowing without manual work. They are a building block of the workflows we deliver in our automation service.

FAQ

Questions about Cron job.

Another question?

Write to us
What is a cron job?
A task that a scheduler runs automatically at a set time or interval, such as a nightly backup or a weekly report.
How do I read a cron expression?
It has five fields: minute, hour, day of month, month and day of week. For example, 30 2 * * * means every day at 02:30.
What is a crontab?
The file that lists a user's scheduled jobs, each on its own line with a time pattern followed by a command.
What is the difference between a cron job and a webhook?
A cron job starts at a scheduled time. A webhook starts when an external event sends a request.
Why did my cron job not run?
Common causes are a wrong time zone, relative paths, a missing environment variable or a script without execute permission.
Can I schedule tasks without a server?
Yes. Serverless platforms and automation tools such as Supabase, Cloudflare Workers, Make and n8n can run schedules for you.

Related

Related terms, and where to go next.

HubSpot web design that connects campaigns, content and CRM
Design

HubSpot web design that connects campaigns, content and CRM

Learn how HubSpot web design connects campaigns, content and CRM so your site supports acquisition, conversion and sales follow-up.

Read the article
BeBranded
AI & automation

Automate your website with AI in 2026

Automate a website with AI: chatbots, Webflow MCP connector, Make, custom AI agents. Three levels, concrete use cases, and pitfalls to avoid.

Read the article
Claude AI: complete guide to use it effectively (2026)
AI & automation

Claude AI: what it is, how to access it and how to use it well (2026)

Discover Claude AI: how it works, real-world use cases, ready-to-use prompts, honest ChatGPT comparison, and best practices to save time in your daily workflow.

Read the article

Let’s talk

Tell us what you want to build.

Thirty minutes with the people who will work on your project. You leave with a clear view of the scope, the timeline and the next steps.

What happens next

  1. 1A 30-minute callWe listen to your goals, your constraints and your context.
  2. 2A clear scopeWe map what is worth doing first, and what it takes.
  3. 3A costed proposalYou decide, with no commitment and no sales pitch.