NEW
A time-based scheduler for executing recurring tasks on Unix-like systems.
DESCRIPTION
Cron is a long-running daemon that executes commands at scheduled dates and times specified by crontab expressions. It underpins routine operations such as backups, data extracts, ETL jobs, log rotation, and system maintenance. Cron expressions define minute, hour, day-of-month, month, and day-of-week fields to control schedules. Modern alternatives include systemd timers and orchestration tools like Airflow and Kubernetes CronJobs, which add dependency management and observability.
ALTERNATIVE DEFINITIONS
Wikipedia
The software utility cron is a time-based job scheduler in Unix-like operating systems.
Concise description emphasizing time-based scheduling on Unix-like systems.
man7 Linux man-pages
cron - daemon to execute scheduled commands (Vixie Cron)
Defines cron as a daemon and references Vixie Cron implementation.
RELATED TERMS
Crontab Quartz Scheduler Task Scheduler Workflow Orchestration Extract-Transform-Load
COMPETING TERMS
Systemd Timers Kubernetes CronJob Apache Airflow
KNOWLEDGE AREAS
Software Engineering Platform & Tooling Data Engineering Infrastructure
TARGET AUDIENCE
DevOps Engineer Software Developer Data Engineer IT Manager Application Administrator
EXTERNAL SOURCES
- Wikipedia - Cron
- man7 Linux man-pages - Crontab file format reference
- Kubernetes - Kubernetes CronJob controller
TOP QUESTIONS
How do Cron expressions work?
Cron expressions specify five fields (minute, hour, day-of-month, month, day-of-week) to schedule recurring executions. Special characters like *, /, and - provide ranges and intervals.
Category: Concepts
What’s the difference between cron and systemd timers?
Cron is a classic scheduler; systemd timers integrate tightly with systemd units, logging, dependencies, and service restarts, offering richer lifecycle management.
Category: Comparison
How is Cron used in data engineering?
Cron triggers ETL jobs, data exports, and health checks. It’s often combined with scripts or containers to run scheduled data tasks reliably.
Category: Usage
What are common pitfalls with Cron?
Environment differences between interactive shells and cron can break scripts. Always set absolute paths, environment variables, and log outputs for troubleshooting.
Category: Mistakes
How do I ensure cron jobs are idempotent?
Use lock files, idempotency checks, or transactional logic to avoid duplicate effects when jobs overlap or are retried.
Category: BestPractice
When should I use Airflow instead of Cron?
Use Airflow for complex DAGs, dependencies, retries, observability, and backfills. Cron suits simple, independent tasks requiring minimal orchestration.
Category: Decision
How do I test a Cron schedule?
Use crontab simulators and run jobs manually with the intended environment. Log start/end times and exit codes to validate correctness.
Category: Testing
How does Kubernetes CronJob relate to Cron?
Kubernetes CronJob implements cron-like scheduling for containers, adding scaling, retries, and cluster-level management.
Category: Integration
How to monitor Cron jobs effectively?
Redirect outputs to logs, send alerts on non-zero exit codes, and track schedules with monitoring tools or wrappers like cronwrap.
Category: Observability