Jump to content

Anacron: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
~
 
(19 intermediate revisions by 14 users not shown)
Line 1: Line 1:
{{Short description|Computer scheduling program}}
{{lowercase}}
{{lowercase}}
{{more footnotes|date=September 2017}}
'''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]]. The current implementation, in [[C (programming language)|C]], was written by Itai Tzur and is actively maintained by Sean 'Shaleh' Perry.
{{Infobox software
| name = anacron
| title = anacron
| logo = <!-- Image name is enough -->
| logo caption =
| logo size =
| logo alt =
| screenshot = <!-- Image name is enough -->
| caption =
| screenshot size =
| screenshot alt =
| collapsible =
| author = Christian Schwarz
| developer = Itai Tzur, Pascal Hakim, Marcela Mašláňová (Red Hat)
| released = <!-- {{Start date and age|YYYY|MM|DD|df=yes/no}} -->
| discontinued =
| latest release version = 2.3
| latest release date = {{Start date and age|2000|06|22}}
| status =
| programming language = [[C (programming language)|C]]
| operating system = [[Linux]]
| platform = [[POSIX]]
| size =
| language =
| language count = <!-- Number only -->
| language footnote =
| genre = Job scheduler
| license =
| alexa =
| website = {{URL|sf.net/projects/anacron}}
| standard =
| AsOf =
}}
'''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 (programming language)|C]] by Itai Tzur; maintainers have included Sean 'Shaleh' Perry and Pascal Hakim.<ref>{{Cite web|url=https://linux.die.net/man/8/anacron|archive-url=https://web.archive.org/web/20180125122117/https://linux.die.net/man/8/anacron|url-status=dead|archive-date=2018-01-25|title=anacron(8): runs commands periodically - Linux man page|date=2018-01-25|access-date=2018-03-31}}</ref>


Since 2009, Red Hat's cron implementation, [[cronie]], has included anacron.<ref>{{cite web |title=Initial upload of anacron-2.3 which should be optimized for better · cronie-crond/cronie@55f4057 |url=https://github.com/cronie-crond/cronie/commit/55f40574a94185a73df8043c4f71f016703c1009 |website=GitHub |language=en}}</ref><ref>{{Cite web|url=https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/6/html/6.7_technical_notes/package-cronie|archive-url=https://web.archive.org/web/20180331234327/https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/6/html/6.7_technical_notes/package-cronie|url-status=dead|archive-date=2018-03-31|title=7.33. cronie - Red Hat Customer Portal|date=2018-03-31|access-date=2018-03-31}}</ref> Since then, anacron has been updated by Red Hat as a part of cronie.<ref>{{Cite web|url=https://github.com/cronie-crond/cronie/blob/master/ChangeLog|title=cronie-crond/cronie - ChangeLog|website=GitHub|language=en|access-date=2018-03-31}}</ref>
== Advantages ==


== 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.
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.


Line 9: Line 45:


== Disadvantages ==
== 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 (command)|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.

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)|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.
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.
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).
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).
Line 21: Line 56:


== See also ==
== See also ==
* [[List of Unix commands]]

* [[List of Unix programs]]
* [[Cron]]
* [[Cron]]


==References==
== External links ==
<references />


== External links ==
* [http://anacron.sourceforge.net/ anacron on SourceForge]
* [[sourceforge:projects/anacron/|anacron on SourceForge]]
* [http://linux.die.net/man/8/anacron anacron(8)] – [[Linux]] Programmer's [[Manual Page (Unix)|Manual]]
* [http://linux.die.net/man/8/anacron anacron(8)] – [[Linux]] Programmer's [[Manual Page (Unix)|Manual]]
*[http://fcron.free.fr/ fcron]
*[http://fcron.free.fr/ fcron]
Line 33: Line 69:
{{Unix commands}}
{{Unix commands}}


[[Category:Unix process and task management-related software]]
[[Category:Unix process- and task-management-related software]]

Latest revision as of 03:35, 27 September 2024

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; 24 years ago (2000-06-22)
Repository
Written inC
Operating systemLinux
PlatformPOSIX
TypeJob scheduler
Websitesf.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]

Since 2009, Red Hat's cron implementation, cronie, has included anacron.[2][3] Since then, anacron has been updated by Red Hat as a part of cronie.[4]

Advantages

[edit]

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

[edit]

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

[edit]

References

[edit]
  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. ^ "Initial upload of anacron-2.3 which should be optimized for better · cronie-crond/cronie@55f4057". GitHub.
  3. ^ "7.33. cronie - Red Hat Customer Portal". 2018-03-31. Archived from the original on 2018-03-31. Retrieved 2018-03-31.
  4. ^ "cronie-crond/cronie - ChangeLog". GitHub. Retrieved 2018-03-31.
[edit]