Generated by GPT-5-mini| anacron | |
|---|---|
| Name | anacron |
| Developer | Paolo Abeni; later GNU Project contributors |
| Released | 1993 |
| Latest release | varies by distribution |
| Operating system | Unix-like |
| License | GNU General Public License |
anacron
Anacron is a Unix-like system utility that schedules and executes recurring tasks on systems that are not guaranteed to run continuously. It complements traditional batch schedulers by ensuring periodic jobs are run at least once within specified intervals, making it useful for laptops, desktops, and intermittently powered servers. Anacron integrates with existing maintenance frameworks and has influenced a variety of task-scheduling implementations across free software ecosystems.
Anacron provides interval-based job execution, distinguishing itself from time-of-day schedulers by focusing on "run at least every N days" semantics. It cooperates with existing maintenance infrastructures such as cron, systemd, Debian, Red Hat Enterprise Linux, Ubuntu, and Fedora deployment patterns. The utility interacts with packaging systems and init systems including SysVinit, Upstart, and systemd service units to ensure jobs scheduled by distribution maintainers are executed even after extended downtime. Anacron's role is especially prominent in workstation environments associated with projects like KDE, GNOME, and distributions maintained by organizations such as Canonical (company), SUSE, and Arch Linux.
Anacron originated in the early 1990s to address limitations in task scheduling on intermittent systems, with initial work attributed to Paolo Abeni and subsequent maintenance by contributors within the GNU Project and various distribution teams. Its adoption grew through integration into maintenance scripts of distributions like Debian, Slackware, and Gentoo Linux. Over time, contributors from communities around Red Hat, Canonical (company), and SUSE adapted policy and packaging to coordinate anacron with other scheduling tools. The rise of alternative init and scheduling frameworks in projects led by organizations such as Freedesktop.org and developers associated with systemd prompted discussions about anacron's role in modern distributions.
Anacron's core design centers on a simple, robust model: a spool directory recording timestamps, a configuration file enumerating jobs and intervals, and a single daemon or invoked runner that executes commands sequentially. The tool supports features such as job retries, randomized delays to avoid thundering-herd effects relative to network services like NetworkManager or systemd-networkd, and per-job configuration for mail notifications historically associated with systems using sendmail, Postfix, or Exim. The implementation prioritizes portability across Unix-like environments including FreeBSD, NetBSD, OpenBSD, and GNU/Linux distributions; it interacts with package-maintainer scripts in ecosystems like Debian Project and Arch Linux's AUR. Security considerations include running tasks with appropriate user privileges and cooperating with access control mechanisms in systems managed by SELinux or AppArmor.
Anacron typically reads configuration from a system file managed by distribution packages; administrators integrate jobs by adding entries specifying period, delay, job-identifier, and command. Common conventions place job scripts in directories used by distribution-maintained frameworks such as those in Debian's /etc/cron.* hierarchy, often invoked by wrapper scripts coordinated with cron or init scripts from SysVinit or service units from systemd. Usage patterns include invoking the anacron runner at boot by init scripts, scheduling via cron @reboot entries, or integration with distribution-specific boot-time targets like systemd's multi-user.target. Administrators often combine anacron with logging facilities such as rsyslog, systemd-journald, or monitoring stacks like Nagios and Icinga to track job outcomes.
Unlike time-based utilities such as cron that assume continuous uptime and execute jobs at specific clock times, anacron guarantees execution within a bounded interval after missed runs, which aligns with the usage models of many desktop distributions and laptop deployments. Conversely, systemd provides systemd-timers that can express both calendar-based and monotonic intervals, with options to run missed jobs after boot; this has led distributions integrating systemd—including Fedora Project, Arch Linux, and openSUSE—to prefer native timer units for unified service management. Nevertheless, anacron remains simpler and more portable across environments that do not use systemd, and it integrates with traditional tooling from projects like Debian where maintainers value predictable, minimal dependencies.
Anacron is implemented in C and distributed under the GNU General Public License by maintainers associated with the GNU Project and various distribution package maintainers. It is packaged across many Unix-like platforms, including major GNU/Linux distributions such as Debian, Ubuntu, Fedora, CentOS, RHEL, openSUSE, Arch Linux, and userland ports for BSDs like FreeBSD and NetBSD. Variants and related tools have been developed in scripting languages by contributors in communities around Gentoo Linux and smaller distributions; integration points often involve init systems like SysVinit, Upstart, and systemd service management. Administrators choose anacron when portability, simplicity, and the guarantee of "at least once per interval" semantics are primary concerns.
Category:Unix utilities