[comp.unix.xenix] Cron Problems

vortex@charlie.OZ (Mark Gregson) (06/20/89)

	I have a small problem with cron on a Xenix 286 system running
	system V version 2.2.1. 
	At present I have a job in the file /usr/spool/cron/crontabs/root
	that has this entry 0 23 * * * /usr/markg/news.
	The idea behind this entry is to have the program news run at
	2300 hours or 11pm, which does happen. However, this program 
	also executes at 500 hours or 5am?? Which it is not supposed to
	do. Can anyone please tell me why this type of error would 
	possibly occur??

johngm@dhw68k.cts.com (John Miller) (07/19/89)

In article <7613@charlie.OZ>, vortex@charlie.OZ (Mark Gregson) writes:
> 
> 	I have a small problem with cron on a Xenix 286 system running
> 	system V version 2.2.1. 
> 	At present I have a job in the file /usr/spool/cron/crontabs/root
> 	that has this entry 0 23 * * * /usr/markg/news.
> 	The idea behind this entry is to have the program news run at
> 	2300 hours or 11pm, which does happen. However, this program 
> 	also executes at 500 hours or 5am?? Which it is not supposed to
> 	do. Can anyone please tell me why this type of error would 
> 	possibly occur??

This happened to me also, but I found a fix and SCO confirmed it.   When
your version of cron was written the timer variable was assigned as a short
int.   Consequently when a certain amount of time passes between cron jobs
the timer variable will roll over.  When this happens cron executes your 
job again.  The solution is to run a do nothing job about 12 hours before
your job.  I run mine at 1:30PM.  Just run something like /bin/true.

John Miller

johngm@dhw68k.com

jcw@jwren.UUCP (John C. Wren) (07/22/89)

Actually, the best fix to the cron problem is let /bin/true run every 6
hours.  This keeps you from having to worry about how scheduling other
jobs may or may not affect it.  I had this problem, and it really hacked
me off until someone just guessing said what the problem might be.  Sure
enough, worked like a champ.

						- John C. Wren
						  jcw@jwren

richard@berner.uucp (Richard Greenall) (07/27/89)

In article <241@jwren.UUCP> jcw@jwren.UUCP (John C. Wren) writes:
>
>Actually, the best fix to the cron problem is let /bin/true run every 6
>hours.  This keeps you from having to worry about how scheduling other
>jobs may or may not affect it.  I had this problem, and it really hacked
>me off until someone just guessing said what the problem might be.  Sure
>enough, worked like a champ.
>

Actually SCO has a fix for this, and it is xnx080