Anacron

Last updated
anacron
Original author(s) Christian Schwarz
Developer(s) Itai Tzur, Pascal Hakim, Marcela Mašláňová (Red Hat)
Stable release
2.3 / June 22, 2000;21 years ago (2000-06-22)
Repository
  • [cvs://anonymous@anacron.cvs.sourceforge.net:/cvsroot/anacron cvs://anonymous@anacron.cvs.sourceforge.net:/cvsroot/anacron] OOjs UI icon edit-ltr-progressive.svg
Written in C
Operating system Linux
Platform POSIX
Type Job scheduler
Website sf.net/projects/anacron

anacron is a computer program that performs periodic command scheduling, which is traditionally done by cron, but without assuming that the system is running continuously. Thus, it can be used to control the execution of daily, weekly, and monthly jobs (or anything with a period of n days) on systems that don't run 24 hours a day. anacron was originally conceived and implemented by Christian Schwarz in Perl, for the Unix operating system. It was later rewritten in C by Itai Tzur; maintainers have included Sean 'Shaleh' Perry and Pascal Hakim. [1] It is a dependency of cronie which is maintained by Red Hat, [2] [3] and Red Hat updates to cronie have included updates to anacron as well. [4]

Contents

Advantages

Unix systems commonly run "housekeeping chores" such as log rotation, unused files deletion, indexing local files for the search engine, sending disk usage reports, etc. A program called cron may be used to schedule these tasks.

With cron, tasks are commonly scheduled to be executed when the system is expected to be idle. If the system is off at the moment a task should be run, it will not be executed. Anacron is different and moves tasks to different moments so they are run when the system is on and utilising cron.

Disadvantages

Only the system administrator can configure anacron tasks. In contrast, cron allows non-admin users to configure scheduled tasks. If necessary, a non-admin user can use the at Unix command to request a scheduled task (which is guaranteed to run). Upon starting, this command can then automatically request to run itself at a future date, thus giving the appearance of a regularly scheduled task, with guaranteed execution.

anacron can run tasks only once a day (or less often such as weekly or monthly). In contrast, cron allows tasks to run as often as every minute (but does not guarantee their execution if the system goes down). In practice, this is not usually an issue, since it is rare to have a task that must be guaranteed to run more often than (at least) once a day — especially on a system that is not necessarily running at all times.

If the system is rebooted or started after midnight, the daily tasks are run after a user-specified delay in synchronized fashion (sequential order), so only one anacron-task is running at a time. When that task is finished, the next one starts and so on.

This behaviour can be overridden to allow concurrent (parallel) tasks, but can consume system resources that are needed by the user to do work. In contrast, cron will only run daily tasks at the time set (e.g. in the middle of the night, when presumably the machine is not being used).

fcron is another implementation of cron, which attempts to fulfill the roles of both Vixiecron and anacron.

See also

Related Research Articles

Cygwin Unix subsystem for Windows machines

Cygwin is a POSIX-compatible programming and runtime environment that runs natively on Microsoft Windows. Under Cygwin, source code designed for Unix-like operating systems may be compiled with minimal modification and executed.

Computer multitasking Concurrent execution of multiple processes

In computing, multitasking is the concurrent execution of multiple tasks over a certain period of time. New tasks can interrupt already started ones before they finish, instead of waiting for them to end. As a result, a computer executes segments of multiple tasks in an interleaved manner, while the tasks share common processing resources such as central processing units (CPUs) and main memory. Multitasking automatically interrupts the running program, saving its state and loading the saved state of another program and transferring control to it. This "context switch" may be initiated at fixed time intervals, or the running program may be coded to signal to the supervisory software when it can be interrupted.

Operating system Software that manages computer hardware resources

An operating system (OS) is system software that manages computer hardware, software resources, and provides common services for computer programs.

Shell script Script written for the shell, or command line interpreter, of an operating system

A shell script is a computer program designed to be run by the Unix shell, a command-line interpreter. The various dialects of shell scripts are considered to be scripting languages. Typical operations performed by shell scripts include file manipulation, program execution, and printing text. A script which sets up the environment, runs the program, and does any necessary cleanup or logging, is called a wrapper.

Computerized batch processing is the running of "jobs that can run without end user interaction, or can be scheduled to run as resources permit."

at (command) Standard UNIX utility

In computing, at is a command in Unix-like operating systems, Microsoft Windows, and ReactOS used to schedule commands to be executed once, at a particular time in the future.

In computing, the superuser is a special user account used for system administration. Depending on the operating system (OS), the actual name of this account might be root, administrator, admin or supervisor. In some cases, the actual name of the account is not the determining factor; on Unix-like systems, for example, the user with a user identifier (UID) of zero is the superuser, regardless of the name of that account; and in systems which implement a role based security model, any user with the role of superuser can carry out all actions of the superuser account. The principle of least privilege recommends that most users and applications run under an ordinary account to perform their work, as a superuser account is capable of making unrestricted, potentially adverse, system-wide changes.

Daemon (computing) Computer program that runs as a background process

In multitasking computer operating systems, a daemon is a computer program that runs as a background process, rather than being under the direct control of an interactive user. Traditionally, the process names of a daemon end with the letter d, for clarification that the process is in fact a daemon, and for differentiation between a daemon and a normal computer program. For example, syslogd is a daemon that implements system logging facility, and sshd is a daemon that serves incoming SSH connections.

cron Job scheduler for Unix-like operating systems

The croncommand-line utility, also known as cron job, is a job scheduler on Unix-like operating systems. Users who set up and maintain software environments use cron to schedule jobs to run periodically at fixed times, dates, or intervals. It typically automates system maintenance or administration—though its general-purpose nature makes it useful for things like downloading files from the Internet and downloading email at regular intervals.

Privilege escalation Gaining control of computer privileges beyond what is normally granted

Privilege escalation is the act of exploiting a bug, a design flaw, or a configuration oversight in an operating system or software application to gain elevated access to resources that are normally protected from an application or user. The result is that an application with more privileges than intended by the application developer or system administrator can perform unauthorized actions.

sudo Command on Unix systems to temporarily assume root privileges

sudo is a program for Unix-like computer operating systems that enables users to run programs with the security privileges of another user, by default the superuser. It stands for "superuser do", as originally that is all it did, and it is its most common usage; however, a common false etymology is "substitute user, do", because sudo can run a command as other users as well.

Webmin Web-based system configuration tool for Unix-like systems

Webmin is a web-based system configuration tool for Unix-like systems, although recent versions can also be installed and run on Microsoft Windows. Webmin allows the user to configure operating system internals, such as users, disk quotas, services or configuration files, as well as modify and control open-source apps, such as the Apache HTTP Server, PHP or MySQL.

In computing, preemption is the act of temporarily interrupting an executing task, with the intention of resuming it at a later time. This interrupt is done by an external scheduler with no assistance or cooperation from the task. This preemptive scheduler usually runs in the most privileged protection ring, meaning that interruption and resuming are considered highly secure actions. Such a change in the currently executing task of a processor is known as context switching.

A job scheduler is a computer application for controlling unattended background program execution of jobs. This is commonly called batch scheduling, as execution of non-interactive jobs is often called batch processing, though traditional job and batch are distinguished and contrasted; see that page for details. Other synonyms include batch system, distributed resource management system (DRMS), distributed resource manager (DRM), and, commonly today, workload automation (WLA). The data structure of jobs to run is known as the job queue.


This is a comparison of notable free and open-source configuration management software, suitable for tasks like server configuration, orchestration and infrastructure as code typically performed by a system administrator.

A number of computer operating systems employ security features to help prevent malicious software from gaining sufficient privileges to compromise the computer system. Operating systems lacking such features, such as DOS, Windows implementations prior to Windows NT, CP/M-80, and all Mac operating systems prior to Mac OS X, had only one category of user who was allowed to do anything. With separate execution contexts it is possible for multiple users to store private files, for multiple users to use a computer at the same time, to protect the system against malicious users, and to protect the system against malicious programs. The first multi-user secure system was Multics, which began development in the 1960s; it wasn't until UNIX, BSD, Linux, and NT in the late 80s and early 90s that multi-tasking security contexts were brought to x86 consumer machines.

Linux startup process is the multi-stage initialization process performed during booting a Linux installation. It is in many ways similar to the BSD and other Unix-style boot processes, from which it derives.

Windows Task Scheduler Computer application of Microsoft Windows

Task Scheduler is a job scheduler in Microsoft Windows that launches computer programs or scripts at pre-defined times or after specified time intervals. Microsoft introduced this component in the Microsoft Plus! for Windows 95 as System Agent. Its core component is an eponymous Windows service. The Windows Task Scheduler infrastructure is the basis for the Windows PowerShell scheduled jobs feature introduced with PowerShell v3.

fcron is a computer program with a GNU General Public License license that performs periodic command scheduling. It has been developed on Linux and should work on POSIX systems. As with Anacron, it does not assume that the system is running continuously, and can run in systems that do not run all the time or regularly. It aims to replace Vixie-cron and Anacron with a single integrated program, providing many features missing from the original Cron daemon.

VisualCron is a job scheduler and automation tool for Windows.

References

  1. "anacron(8): runs commands periodically - Linux man page". 2018-01-25. Archived from the original on 2018-01-25. Retrieved 2018-03-31.
  2. "7.33. cronie - Red Hat Customer Portal". 2018-03-31. Archived from the original on 2018-03-31. Retrieved 2018-03-31.
  3. "Automate Linux with Cron and Anacron | TuxRadar Linux". 2017-09-14. Archived from the original on 2017-09-14. Retrieved 2018-03-31.
  4. "cronie-crond/cronie - cronie-1.5.1 release". GitHub. Retrieved 2018-03-31.