LLMpediaThe first transparent, open encyclopedia generated by LLMs

cron

Generated by GPT-5-mini
Note: This article was automatically generated by a large language model (LLM) from purely parametric knowledge (no retrieval). It may contain inaccuracies or hallucinations. This encyclopedia is part of a research project currently under review.
Article Genealogy
Parent: Sendmail Hop 4
Expansion Funnel Raw 66 → Dedup 0 → NER 0 → Enqueued 0
1. Extracted66
2. After dedup0 (None)
3. After NER0 ()
4. Enqueued0 ()
cron
cron
VectorVoyager · CC BY-SA 4.0 · source
Namecron
Typejob scheduler
DeveloperVarious (Ken Thompson, Paul Vixie)
Released1970s
Operating systemUnix, Unix-like, Linux, BSD, macOS
LicenseVaries (BSD, ISC, proprietary)

cron is a time-based job scheduler widely used on Unix-like systems to run commands or scripts at specified times and dates. It automates routine tasks such as system maintenance, backups, and data processing by invoking programs on a schedule. Originating in early Unix research, it remains a cornerstone of server administration and embedded systems operations.

Overview

cron provides a mechanism for invoking programs at future times, integrating with system initialization and user environments to launch tasks unattended. Administrators and developers use it to coordinate tasks across services like System V init, systemd, Apache HTTP Server, MySQL, and PostgreSQL; to perform backups for rsync, tar, and Bacula; and to refresh caches for Varnish, Memcached, and Redis. It interacts with logging facilities such as syslog and monitoring systems including Nagios, Zabbix, and Prometheus.

History

The concept of scheduled job execution traces to Multics and early UNIX research at Bell Labs. Early implementations appeared in Seventh Edition Unix and were refined by developers like Ken Thompson and later Paul Vixie, who published a popular implementation used in many Linux distributions. Over decades, implementations adapted to changes in init systems (for example, migration from System V init to systemd), containerization platforms like Docker and orchestration systems such as Kubernetes, which introduced alternatives for timed execution in clustered environments.

Scheduling format and syntax

The classic scheduling configuration uses a five-field time specification and a command field, permitting expressions for minute, hour, day of month, month, and day of week. Administrators employ wildcards, ranges, lists, and step values to represent schedules, and may combine entries with environment assignments and redirection to utilities like mailx or sendmail for notifications. Macros and special strings (e.g., @reboot) simplify recurring entries for services such as OpenSSH and Postfix when integrated into system startup sequences documented by distributions like Debian and Red Hat Enterprise Linux.

Implementation and variants

Multiple implementations exist, including the traditional Vixie cron, the BSD cron family, and alternatives such as fcron and anacron. Platform vendors bundle implementations with distributions including Ubuntu, Fedora, FreeBSD, and NetBSD, while commercial vendors provide proprietary scheduling services in appliances from companies like IBM and Oracle Corporation. Cloud providers offer managed scheduling via services on Amazon Web Services, Microsoft Azure, and Google Cloud Platform that mirror cron semantics for virtual machines and serverless functions.

Configuration and administration

Scheduling entries reside in system-wide tables and per-user tables, managed with utilities like crontab and service management via init systems such as systemd units or legacy scripts. Administrators audit schedules during compliance reviews alongside configuration management tools like Ansible, Puppet, Chef, and SaltStack to enforce policies in environments run by organizations such as Red Hat, SUSE, and Canonical. Permissions, mail handling, and environment variables are important when coordinating jobs that interact with databases like Oracle Database, MongoDB, or with version control systems such as Git hosted on GitHub or GitLab.

Security and limitations

Security considerations include privilege separation, safe handling of environment variables, and protecting credentials used by scheduled tasks that interact with services like AWS Identity and Access Management, Kubernetes Secrets, and HashiCorp Vault. Race conditions, overlapping jobs, and missed schedules under heavy load can affect systems running critical infrastructure like OpenStack or Ceph. Limitations of classic implementations led to complementary tools such as anacron for systems not always powered, and to orchestration-level timers in Kubernetes and systemd that provide more robust behavior under dynamic conditions.

Use cases and examples

Common use cases include rotating logs with logrotate, performing backups with BorgBackup or Duplicity, database maintenance for PostgreSQL and MySQL, certificate renewal with Let’s Encrypt clients, and scheduled ETL pipelines interacting with Apache Kafka and Hadoop. Example patterns used in production environments managed by teams at organizations like Facebook, Twitter, and Netflix include staggered schedules to reduce load, chaining tasks with orchestration frameworks such as Apache Airflow and Luigi, and migrating cron-based jobs into cloud-native schedulers provided by Google Cloud Scheduler or AWS Lambda triggers.

Category:Unix software