ArticleslgStudy

computer science

Anacron

Anacron is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Anacron rather than just read about it. In short: 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…

Key takeaways

  • Anacron belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Anacron to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Anacron from memory before moving on to harder problems.

Reference excerpt

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. Since 2009, Red Hat's cron implementation, cronie, has included anacron. Since then, anacron has been updated by Red Hat as a part of cronie.

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 List of Unix commands Cron

References

External links anacron on SourceForge anacron(8) – Linux Programmer's Manual fcron

Worked examples

Example 1 — a first encounter with Anacron

Start with the simplest possible case. Write down what Anacron claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Anacron before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Anacron ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Anacron

In research
Anacron appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Anacron in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Anacron is common in secondary-school and first-year university syllabi. It links to neighbouring topics Unix process- and task-management-related software, so understanding it makes those chapters shorter.
In everyday life
Look for Anacron outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Anacron” →

How to study Anacron in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Anacron means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Anacron out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Anacron in simple terms?

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 syste…

Why does Anacron matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Anacron?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Anacron.

Tags

  • Unix process- and task-management-related software

Keep exploring