Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 9 Feb 2006 21:12:15 -0600
From:      Dan Nelson <dnelson@allantgroup.com>
To:        freebsd-questions <freebsd-questions@freebsd.org>
Subject:   Re: Replacing cron with mcron
Message-ID:  <20060210031215.GB2090@dan.emsphone.com>
In-Reply-To: <20060210024758.GJ357@tigger.digitaltorque.ca>
References:  <18e02bd30602090028y10c0ae8eyd186ee790062c93a@mail.gmail.com> <20060210024758.GJ357@tigger.digitaltorque.ca>

next in thread | previous in thread | raw e-mail | index | archive | help
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



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