What is a cron job? scheduling basics explained
What is a cron job?
A cron job is a task scheduled to run automatically at specified times or intervals on a Unix-like operating system. The name comes from "chronos" (Greek for time), and the cron daemon — the background process that executes these tasks — has been a Unix staple since Version 7 in 1979. If you've ever needed a script to run every morning at 6 AM, a database backup to happen every Sunday at midnight, or an API to be polled every 15 minutes, a cron job is the traditional answer.
The Linux Foundation's 2024 report noted that over 90% of cloud workloads run on Linux. Most of those systems use cron or a cron-compatible scheduler for recurring tasks. Unlike generic AI automation posts, this guide shows real CodeWords workflows — not just theory.
How cron syntax works
A cron expression uses five fields: minute (0–59), hour (0–23), day of month (1–31), month (1–12), day of week (0–7). Examples: 0 9 * * 1-5 (9:00 AM Monday through Friday), */15 * * * * (every 15 minutes), 0 0 1 * * (midnight on the first of every month).
What cron can't do
No dependency management — cron fires at the scheduled time regardless of whether the previous run finished. No failure recovery — if a cron job fails, cron doesn't retry. No variable scheduling — can't express "last day of the month" natively. No state — cron doesn't know what happened in the last run.
Modern alternatives to cron jobs
Cloud schedulers like AWS EventBridge, Google Cloud Scheduler, and Azure Logic Apps offer cron-compatible syntax with managed infrastructure, adding retries, dead-letter queues, and monitoring dashboards.
Workflow orchestrators like Apache Airflow, Prefect, and Temporal replace cron with DAG-based scheduling — tasks have dependencies, retries, and state management built in.
AI automation platforms like CodeWords abstract scheduling entirely. Tell Cody "run this every weekday at 9 AM" or "run this on the last business day of each month" and get a serverless workflow with proper scheduling, retries, and state persistence via Redis.
When you still want a cron job
Cron remains the right choice for single-server tasks that are simple, self-contained, and don't need monitoring: log rotation, cache clearing, local backups. If the task runs on one machine, takes seconds, and failure just means it runs again next time — cron is perfect. For everything else, use a platform built for it. CodeWords offers templates for common scheduled patterns and transparent pricing for execution-based billing.



