Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Linux Forums > Linux - Server
User Name
Linux - Server This forum is for the discussion of Linux Software used in a server related context.


  Search this Thread
Old 03-07-2007, 07:12 PM   #1
LQ Newbie
Registered: Jun 2006
Location: WA, USA
Distribution: Fedora Core 10
Posts: 16

Rep: Reputation: 5
Question cron file 000-delay.cron (it is on my FC5) - what is the purpose?

I found the file 000-delay.cron.
It introduces a per-machine static sleep before cron jobs.
My guess it that putting a random wait for cron jobs for all *nix machines reduces traffic jams.

For example, what if all machines in a network ran the cron job download-huge-file.cron at the same time? It would cause a big lag for the whole network!

Does anyone else have thoughts on why the file 000-delay.cron exists?

$ cat /etc/cron.daily/000-delay.cron

# Generate per system static delay for cron.{daily,weekly,monthly}

# (P) & (C) 2006 by Peter Bieringer <>
# 20060322/PB: initial release

# License: GPLv2

factor=1        # max. ~ 68 minutes
#factor=2       # max. ~ 34 minutes

# Create md5sum of hostname (static over system lifetime)
md5sum="`echo ${HOSTNAME} | md5sum`"

# Extract the first 3 hexdigits (12 Bit: 0-4095)

# Create decimal value
decvalue="`printf "%d" "0x${hexvalue}"`"

# Divide delay by factor
DELAY=$[ ${decvalue} / ${factor} ]

sleep $DELAY
exit 0


This was also posted here:
Old 03-08-2007, 12:15 PM   #2
Senior Member
Registered: Jan 2005
Location: Manalapan, NJ
Distribution: Fedora x86 and x86_64, Debian PPC and ARM, Android
Posts: 4,593
Blog Entries: 2

Rep: Reputation: 332Reputation: 332Reputation: 332Reputation: 332
It's function is to prevent unintentional denial of service attacks on servers. For example, you have 4000 machines, and daily (in the cron.daily directory) they run ntpdate. Without 000-delay.cron, all 4000 machines would hit the time server at exactly the same time (probably causing it grief, or even killing it).

The 000-delay.cron delay is only introduced at the begining of the sequential execution of all jobs in the cron.daily, cron.weekly and cron.monthly directories.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
shell script using /etc/cron.hourly to execute cron.php file? rioguia Programming 3 06-11-2008 09:09 AM
cron not working from crontab nor form /etc/cron/cron.d. What did SuSE change? JZL240I-U SUSE / openSUSE 11 01-04-2007 02:57 AM
Slackware's Cron Scheduler: I'm thinking maybe I need to put in a different cron? Old_Fogie Slackware 5 11-03-2006 07:25 AM
Can any one plz explain why/what for cron.d, cron.daily, cron.weekly etc are there. mavinashbabu Linux - Newbie 4 09-21-2006 02:50 PM
[cron][mdk9.1]cron deamon seems to ignore some task... yannrichet Linux - Newbie 5 06-26-2003 10:57 AM > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 07:27 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration