From owner-freebsd-questions@FreeBSD.ORG Fri Feb 10 03:12:17 2006 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 64DD716A420 for ; Fri, 10 Feb 2006 03:12:17 +0000 (GMT) (envelope-from dan@dan.emsphone.com) Received: from dan.emsphone.com (dan.emsphone.com [199.67.51.101]) by mx1.FreeBSD.org (Postfix) with ESMTP id E22EB43D45 for ; Fri, 10 Feb 2006 03:12:16 +0000 (GMT) (envelope-from dan@dan.emsphone.com) Received: (from dan@localhost) by dan.emsphone.com (8.13.1/8.13.3) id k1A3CFlZ008751 for freebsd-questions@freebsd.org; Thu, 9 Feb 2006 21:12:15 -0600 (CST) (envelope-from dan) Date: Thu, 9 Feb 2006 21:12:15 -0600 From: Dan Nelson To: freebsd-questions Message-ID: <20060210031215.GB2090@dan.emsphone.com> References: <18e02bd30602090028y10c0ae8eyd186ee790062c93a@mail.gmail.com> <20060210024758.GJ357@tigger.digitaltorque.ca> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20060210024758.GJ357@tigger.digitaltorque.ca> X-OS: FreeBSD 5.4-STABLE X-message-flag: Outlook Error User-Agent: Mutt/1.5.11 Subject: Re: Replacing cron with mcron X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2006 03:12:17 -0000 In the last episode (Feb 09), Michael P. Soulier said: > On 09/02/06 Iantcho Vassilev said: > > Has anyone tried this? I even think of proposing this to the base > > system - cron is such an old idea.. > > What does mcron offer? My main complaints about cron are: > > 1. Difficult to do refined timing, like execute on the first tuesday > of each month. I tend to use remind for this, by David Skoll. Something like that rule could be done with a bit of shell script: 0 0 0 0 2 [ $(date +%d) -le 7 ] && real_command For more compilcated rules you may be able to coax /usr/bin/calendar into doing the date math. Or have cron call calendar's date parser directly given a suitably-formatted crontab line. > 2. It leaves synchronization up to the app, so it will happily start > multiple instances of a job that's taking too long. > > To work around #2, I find something like daemontools or runit a nicer > way to solve the problem. Lockfile from the promail port works for me. You could probably use /usr/bin/lockf also. -- Dan Nelson dnelson@allantgroup.com