Home  /  Blogs  /  Software

What Is a Cron Job?

25 Jun 2026 JBX Editorial Software 4 min read

What Is a Cron Job?

A cron job is a scheduled task on a Linux or Unix-based system that runs a script or command automatically at a set time or interval, without anyone needing to trigger it manually. It's managed by a background service called "cron," which checks a schedule file (the crontab) and executes whatever task is due, whether that's every minute, every night, or once a month.

Understanding Cron Syntax

A cron schedule is written as five fields representing minute, hour, day of month, month, and day of week, followed by the command to run. For example, 0 2 * * * means "run at 2:00 AM every day," while */15 * * * * means "run every 15 minutes." Asterisks act as wildcards meaning "every" unit of that field, and specific numbers or ranges restrict it to particular times.

Common Uses and Best Practices

Cron jobs are widely used for automated database backups, clearing temporary files, sending scheduled reports or reminder emails, refreshing cached data, and running website maintenance scripts overnight when traffic is low. Good practice includes logging the output of every cron job so failures are visible, setting up alerts if a critical job doesn't run successfully, and avoiding overlapping schedules for jobs that shouldn't run simultaneously — a silently failing cron job is one of the most common causes of "mystery" data or backup issues on a server.

Share this article: