Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 16 Sep 2001 20:07:14 -0500
From:      Alfred Perlstein <bright@mu.org>
To:        Ben Smithurst <ben@FreeBSD.org>
Cc:        Tim Allshorn <ta_iy@hotmail.com>, freebsd-hackers@freebsd.org
Subject:   Re: Cron pickle
Message-ID:  <20010916200714.X968@elvis.mu.org>
In-Reply-To: <20010917014932.V43502@strontium.shef.vinosystems.com>; from ben@FreeBSD.org on Mon, Sep 17, 2001 at 01:49:32AM %2B0100
References:  <F243F4r4rPKlNonsYKU00010632@hotmail.com> <20010917014932.V43502@strontium.shef.vinosystems.com>

next in thread | previous in thread | raw e-mail | index | archive | help
* Ben Smithurst <ben@FreeBSD.org> [010916 19:49] wrote:
> Tim Allshorn wrote:
> 
> >     I know the cron command has to be something like : 59 23 ? ? * , with 
> > maybe some condition on the end.
> 
> I think you could use something like
> 
> 59 23 28-31 * * [ `date -v+1M +%d` -eq 1 ] && /path/to/your/program
> 
> i.e., check that in one minute's time the day of the month is 1, if so,
> run the program.

I'm not a date(1) wizard, but there's a possible issue here, if
the system is loaded cron may skip a beat possibly and that
conditional may be delayed such that it doesn't trigger.

My suggestion would be to use something more sophisticated such as
a file someplace that tracks the last time it was run to make sure
there's no race here.

-- 
-Alfred Perlstein [alfred@freebsd.org]
'Instead of asking why a piece of software is using "1970s technology,"
start asking why software is ignoring 30 years of accumulated wisdom.'

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010916200714.X968>