ofIn a big Unix environment you likely install cron jobs like this on a thousand systems:
If all the system clocks are synchronized (usually via NTP), these jobs run *exactly* at the same time.
If the cron job accesses a shared resource (network file system, database, send mail, ...) there is a load peak!
The solution is to add individual delays.
Say the delay should be within 60 seconds.
bash and ksh have $RANDOM and arithmetics; the following looks promising
Unfortunately % has a special meaning to "cron". It must be escaped \%, and the shell then sees \%.
This is really an obstacle!
I have found the following solutions:
The latter has a static delay - but still individual.
Do you have other solutions?
Last edited by MadeInGermany; 01-08-2014 at 04:45 PM..
Reason: rephrased: often distribute to -> likely install on
This User Gave Thanks to MadeInGermany For This Post:
I am not sure what problem this solves and a number of issues are raised:
Big Unix Environment
Submitting jobs to thousands of systems
load peaks for shared resources
For example, depending on what the task is and the targets, this could just be a matter of updating cron entries on the end systems as opposed to scheduling tasks from the cron of a single system or set of systems. Doing this for a thousand or so systems seems problematic.
I would not do this for a thousand systems, but rather I would either distribute crontabs to remote systems or look for an enterprise sheduling solution (open software; an example of paid-for solutions are products like Control-M).
Enterprise schedulers provide such features as distribution, redundancy and central reporting.
Maybe you misunderstood my post?
I did not mean the distribution to several systems.
Instead I mean: running a cron job on several systems at the same time.
I have rephrased my post.
Dear members, moderators and others.
While working on <insert project>, a need has surfaced to watch a directory, and when a file comes, to do appropriate action.
So, i started writing some shell code, aware of linux inotify-tools package with inotifywait.
Also, i'm seeing a lot of similar... (1 Reply)
Hello,
I have written a cron job to automate the sftp of files using key authentication.
I wanted to add a timeStamp and name of file sent to a log file and append each these details to the same file each time files are sent and if possible include whether the files were sent successfully or not.... (3 Replies)
Hi,
1)
If some job supposed to run on 1st of every month at 7 AM
In cron job when we have a blackout on the 1st ( i.e when 1st falls on a sunday ) how can we make the job run the next business day?
2) How can we run a job on 25th of every quarter 7 AM(jan,apr,jul,oct)
And if 25th... (5 Replies)
A well established form of application cron jobs look like this:
39 15 * * * && /usr/local/monitoring/oracle/check_dbs.sh >/dev/null 2>&1The repetition makes it a long line, hard to read, hard to maintain.
I suggest the following instead:
39 15 * * * { /usr/local/monitoring/oracle/check_dbs.sh... (1 Reply)
Hi ,
I have removed a cron for particular user , but cron job seems to be running even after the cron entry is removed. The purpose of the cron was to sendmail to user ( it uses mailx utility )
I have restarted cron and sendmail service still user is getting mail alerts from the cron job. And... (4 Replies)
Hi,
How to add a cron job in /etc/crontab using a shell script.??:confused:
Actually the requirement is we need to run a script say, XXX.sh every 10 min through “cron”.
That can be achieved by adding the below code line in the /etc/crontab , (i.e., “crontab -e ” command to add this to the... (4 Replies)
I need to write the cron job for the following scenario, Please help me out
The CRON job runs sometime at night on Saturday and checks if there are more than eight files in the /PROCESSED folder. Any files over and above eight are deleted based on ascending order of date (eight most recent... (10 Replies)
I run cron in solaris 10 zone. One cron job which syncing files to nfs mounted on container, creates after finishing another cron proccess(/usr/sbin/cron), and after 100 existing cron proccesses next cron job will not start. It's too weird for me, I'm not able to solve this problem. Theoretically... (3 Replies)