Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 17 Sep 2001 02:19:17 +0100
From:      Ben Smithurst <ben@FreeBSD.org>
To:        Alfred Perlstein <bright@mu.org>
Cc:        Tim Allshorn <ta_iy@hotmail.com>, freebsd-hackers@freebsd.org
Subject:   Re: Cron pickle
Message-ID:  <20010917021917.W43502@strontium.shef.vinosystems.com>
In-Reply-To: <20010916200714.X968@elvis.mu.org>
References:  <F243F4r4rPKlNonsYKU00010632@hotmail.com> <20010917014932.V43502@strontium.shef.vinosystems.com> <20010916200714.X968@elvis.mu.org>

next in thread | previous in thread | raw e-mail | index | archive | help

--nKvJs6ze6az+4fwY
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Alfred Perlstein wrote:

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

I thought only advancing it 1 minute would make it safe.  My reasoning
for not advancing it by 1 day was that if there was enough load to delay
by 61 seconds, then advancing the time from there by one day would lead
to the 2nd.  But I think there would have to be about a 24 hour delay
here for this to go wrong, since advancing it by a minute will still
lead it to end up in the 1st for that long... but then I'm not a date
wizard either, maybe someone who is can step in. :-)

Although just using a file like you suggest might stop everyone being
paranoid that it might go wrong.

--=20
Ben Smithurst / ben@FreeBSD.org                 FreeBSD: The Power To Serve
                                                    http://www.FreeBSD.org/

--nKvJs6ze6az+4fwY
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (FreeBSD)
Comment: For info see http://www.gnupg.org

iD8DBQE7pU+UbPzJ+yzvRCwRAsXaAJwICGNgjapGaxjZvYyZCDNIsh95CgCfZG48
bXVNpU5PMGBaUs2k0T4qGhY=
=PgYR
-----END PGP SIGNATURE-----

--nKvJs6ze6az+4fwY--

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?20010917021917.W43502>