Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

cron vs. anacron. The difference? 1

Status
Not open for further replies.

goldenradium2001

Technical User
Mar 22, 2002
91
0
0
US
I read that the difference between cron and anacron is that cron assumes that the system is on continuously and will only execute a command if the system is on.

This doesn't make sense. Isn't it a fundamental requirement that the system be ON in order for the shell to execute a command????

Help! I need a better definition!

Thanks in advance.
 
More accurately, cron requires that the system be running at the time a job is scheduled.

Cron is a daemon which schedules jobs to run at specific time(s) of day(s). If you need something to be run at 4:23 am every Tuesday of the month, and if it doesn't matter that the job gets skipped if the system is down at 4:23 on a particular Tuesday, cron's your app.

anacron is used to run jobs periodically. If you have a job that must be run every 15 days, or the as soon after 15 days as possible if the system is down on the 15th day, then you use anacron.

anacron's schedule does not have a resolution shorter than a day, and it is not a daemon -- you may see it run on startup, but once it's run all the jobs it needed to, it exits. Look at your cron job configuration files -- you'll probably find entries to fire off anacron. Want the best answers? Ask the best questions: TANSTAAFL!
 
One more question, if anacron doesn't use minutes, what is the delay field for?

Thanks.
 
Also what does the run-parts command mean in the anacrontab file?

Thanks!
 
The delay field is the time in minutes after anacron determines that a job needs to be run that will will wait before running it. You can use this to prevent multiple jobs from running at once.


"run-parts" is arbitrary. It identifies the job, and anacron uses that string in its logging and in the name of the job's timestamp file. Want the best answers? Ask the best questions: TANSTAAFL!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top