1753834 Members
7780 Online
108806 Solutions
New Discussion юеВ

number of cron jobs

 
SOLVED
Go to solution
Shankar_6
Regular Advisor

number of cron jobs

Hi,

Assume a script is scheduled through cron every 5mins and it is getting hung. In this case will cron waits for its completion to remove it from the job queue or it will just keep adding the jobs in the queue?



11 REPLIES 11
Steven E. Protter
Exalted Contributor
Solution

Re: number of cron jobs

Shalom,

cron will keep running what it is told to run.

To avoid this the script being run can check ps output and self terminate.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Roopesh Francis_1
Trusted Contributor

Re: number of cron jobs

Shankar,

cron can run muliple jobs at same time so all the jobs will run as scheduled.

Thanks
Pete Randall
Outstanding Contributor

Re: number of cron jobs

See the man page for queuedefs (4):

"All other queues can have up to 100 jobs running simultaneously. They will be run with a nice value of 2, and if a job cannot be run because too many other jobs are running, cron will wait 60 seconds before trying again to run it."


Pete

Pete
Pete Randall
Outstanding Contributor

Re: number of cron jobs

>> "All other queues" refers to the queues other than at and batch - namely cron.


Pete

Pete
Shankar_6
Regular Advisor

Re: number of cron jobs

Hi All,

thanks for all ur reply.

I am looking for only the number of jobs in the queue..Does cron waits for a script to finish so that it can reduce the count in the cron queue or it just submits the job and leave it irrespective whether it finishes or not..

Pete Randall
Outstanding Contributor

Re: number of cron jobs

I repeat:

See the man page for queuedefs (4):

"All other queues (aside from at and batch) can have up to 100 jobs running simultaneously. They will be run with a nice value of 2, and if a job cannot be run because too many other jobs are running, cron will wait 60 seconds before trying again to run it."


Pete

Pete
Shankar_6
Regular Advisor

Re: number of cron jobs

Hi Pete,

I understood the above reply..

to be simple - when the job started using cron,the queue size will be 1..will it be 1 until it completes or it just submits the job and make the queue size to 0..



Shankar_6
Regular Advisor

Re: number of cron jobs

Hi Steven/Pete,

Any reply from ur end..

I want to know this because one of our server suddenly throwing messages "c queue message reached limit" ..I am sure nothing changed in crontab but could see more ftp sessions got hung..that's the reason i want to know will those jobs be in the queue till it completes or just clear the queue as log it is submitted..

Dennis Handly
Acclaimed Contributor

Re: number of cron jobs

>will it be 1 until it completes

Yes, it waits until it is done, the only important measure.