From owner-freebsd-hackers Sun Sep 16 18:19:34 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from scientia.demon.co.uk (scientia.demon.co.uk [212.228.14.13]) by hub.freebsd.org (Postfix) with ESMTP id 5052437B406 for ; Sun, 16 Sep 2001 18:19:22 -0700 (PDT) Received: from strontium.shef.vinosystems.com ([192.168.91.36] ident=root) by scientia.demon.co.uk with esmtp (Exim 3.30 #1) id 15in49-000676-00; Mon, 17 Sep 2001 02:19:17 +0100 Received: (from ben@localhost) by strontium.shef.vinosystems.com (8.11.6/8.11.4) id f8H1JHe94356; Mon, 17 Sep 2001 02:19:17 +0100 (BST) (envelope-from ben@FreeBSD.org) X-Authentication-Warning: strontium.shef.vinosystems.com: ben set sender to ben@FreeBSD.org using -f Date: Mon, 17 Sep 2001 02:19:17 +0100 From: Ben Smithurst To: Alfred Perlstein Cc: Tim Allshorn , freebsd-hackers@freebsd.org Subject: Re: Cron pickle Message-ID: <20010917021917.W43502@strontium.shef.vinosystems.com> References: <20010917014932.V43502@strontium.shef.vinosystems.com> <20010916200714.X968@elvis.mu.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-md5; protocol="application/pgp-signature"; boundary="nKvJs6ze6az+4fwY" Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20010916200714.X968@elvis.mu.org> X-PGP-Key: http://www.smithurst.org/ben/pgp-key.txt Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG --nKvJs6ze6az+4fwY Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Alfred Perlstein wrote: > * Ben Smithurst [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