"Viper" <viper.RemoveThis@venomx.com> wrote in message
news:C4-dnRdty5Y5bZjdRVn_iw@comcast.com...
> Ok I have a few sites that all need cron to run to work/update... There
was
> so many running at tone time it would crash the server...
>
> A friend told me to try this..
>
> login as root and in cron put
> */20 * * * * /home/jwshcom/CCcrons.sh >/dev/null 2>&1
>
> CCcrons.sh has...
<font color=purple> > /usr/bin/lynx --dump <a style='text-decoration: underline;' href="http://www.domain1.com/scripts/admin/cronjobs.php</font" target="_blank">http://www.domain1.com/scripts/admin/cronjobs.php</font</a>>
<font color=purple> > /usr/bin/lynx --dump <a style='text-decoration: underline;' href="http://www.domain2.net/scripts/admin/cronjobs.php</font" target="_blank">http://www.domain2.net/scripts/admin/cronjobs.php</font</a>>
<font color=purple> > /usr/bin/lynx --dump <a style='text-decoration: underline;' href="http://www.domain3.com/scripts/admin/cronjobs.php</font" target="_blank">http://www.domain3.com/scripts/admin/cronjobs.php</font</a>>
<font color=purple> > /usr/bin/lynx --dump <a style='text-decoration: underline;' href="http://www.domain4.com/scripts/admin/cronjobs.php</font" target="_blank">http://www.domain4.com/scripts/admin/cronjobs.php</font</a>>
<font color=purple> > /usr/bin/lynx --dump <a style='text-decoration: underline;' href="http://www.domain5.com/scripts/admin/cronjobs.php</font" target="_blank">http://www.domain5.com/scripts/admin/cronjobs.php</font</a>>
> etc....
>
> He told me this would run each one right after the other so none ran at
the
> same time... BUT for some reason I am ending up with it doing odd
things...
> say one site has 5 things qued up to do... it should work on one until its
> done then the next time cron runs do the next... well it does all 5 things
> at once and does more than one site at a time... any ideas?
>
First of all, remember *nix is a multi-tasking environment. In most cases if
cron is given several things to do - in the absence of controls - ( a simple
sequence of commands eg) it will do them, to all intents and purposes, at
the same time. Another factor is the complexity (resource usage) of the
scripts being executed by cron will have an effect on timing. A fast small
script in the 5th cron command will run and finish before the much larger
and slower script in the 2nd command as an example.
As far as crashing the server, you would need to be using up considerable
resources for that to happen. Are you sure that is what is happening and
there is not something in your scripts that is creating the problem?
Not sure if you are aware, and no one seems to have mentioned - but - -
You can use cron to run another script that itself controls the action!
Have you tried to run the scripts sequentially with control, (as a test
measure) with cron e-mailing you any error messages
E.G. If you use cron to run mycron. every 20 minutes then
In your mycron. script
check time
if time = a run script 1 | trap error | mail
if time = b run script 2 | trap error | mail
if time = c run script 3 | trap error | mail
end
#etc, etc, etc.
Note - the above is just the algo - I leave the scripting to you depending
on your choice

<!-- ~MESSAGE_AFTER~ -->
>> Stay informed about: red hat/cpanel/cron help needed... Please?