Anacron
Encyclopedia
anacron is a computer program
Computer program
A computer program is a sequence of instructions written to perform a specified task with a computer. A computer requires programs to function, typically executing the program's instructions in a central processor. The program has an executable form that the computer can use directly to execute...

 that performs periodic command scheduling which is traditionally done by cron
Cron
Cron is a time-based job scheduler in Unix-like computer operating systems. Cron enables users to schedule jobs to run periodically at certain times or dates...

, 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
Perl
Perl is a high-level, general-purpose, interpreted, dynamic programming language. Perl was originally developed by Larry Wall in 1987 as a general-purpose Unix scripting language to make report processing easier. Since then, it has undergone many changes and revisions and become widely popular...

, for the Unix
Unix
Unix is a multitasking, multi-user computer operating system originally developed in 1969 by a group of AT&T employees at Bell Labs, including Ken Thompson, Dennis Ritchie, Brian Kernighan, Douglas McIlroy, and Joe Ossanna...

 operating system
Operating system
An operating system is a set of programs that manage computer hardware resources and provide common services for application software. The operating system is the most important type of system software in a computer system...

. The current implementation, in C
C (programming language)
C is a general-purpose computer programming language developed between 1969 and 1973 by Dennis Ritchie at the Bell Telephone Laboratories for use with the Unix operating system....

, was written by Itai Tzur and is actively maintained by Sean 'Shaleh' Perry.

Advantages

Most Unix systems are set up to run "housekeeping chores" such as log-rotation, unused files deletion, indexing local files for the search engine, sending disk usage reports, etc.

With cron
Cron
Cron is a time-based job scheduler in Unix-like computer operating systems. Cron enables users to schedule jobs to run periodically at certain times or dates...

, often these tasks are scheduled to be executed overnight or another low-usage time to avoid straining the system. If the system is turned off at the time a given task should have been run, it will not be executed for that iteration.

In contrast, anacron makes sure that these commands are run at the specified intervals as closely as machine uptime permits. It is a cron-complement (it requires cron) for laptop and home PC users for periodic tasks.

Drawbacks

Only the system administrator
System administrator
A system administrator, IT systems administrator, systems administrator, or sysadmin is a person employed to maintain and operate a computer system and/or network...

 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
At (Unix)
In Unix-like computer operating systems,the at commandis used to schedule commands to be executed once, at a particular time in the future....

 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 only run tasks 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, too, 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
Fcron
fcron is a computer program with a GNU GPL license that performs periodic command scheduling. It has been developed on Linux and should work on POSIX systems. As 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...

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

External links

  • anacron on SourceForge
  • anacron(8)Linux
    Linux
    Linux is a Unix-like computer operating system assembled under the model of free and open source software development and distribution. The defining component of any Linux system is the Linux kernel, an operating system kernel first released October 5, 1991 by Linus Torvalds...

     Programmer's Manual
    Manual page (Unix)
    Man pages are the extensive documentation that comes preinstalled with almost all substantial Unix and Unix-like operating systems. The Unix command used to display them is man. Each page is a self-contained document.- Usage :...

  • fcron
The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK