vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Dillon's Cron (and every other cron as far as I can see) seems slightly backward in its abilities. It can't accommodate a one-off task in a following year. It can't accept dates such as "third sunday in month" or "last day" or "first monday", all of which can be useful at times. Does anybody know an alternative that will accept these scheduled times? Kalarm doesn't get it done because it only runs when someone is logged in, |
| |||
| chris dunn wrote: > Dillon's Cron (and every other cron as far as I can see) > seems slightly backward in its abilities. > > It can't accommodate a one-off task in a following year. by one-off task, you mean a task that is meant to be run only once? cron isn't the right tool for that, you use 'at' instead. -- Joost Kremers joostkremers@yahoo.com Selbst in die Unterwelt dringt durch Spalten Licht EN:SiS(9) |
| |||
| On 29 Sep 2004 21:36:44 GMT, joostkremers@yahoo.com wrote: >> Dillon's Cron (and every other cron as far as I can see) >> seems slightly backward in its abilities. >> >> It can't accommodate a one-off task in a following year. > > by one-off task, you mean a task that is meant to be run only once? cron > isn't the right tool for that, you use 'at' instead. (what Joost said) Also, dcron has suffered less (if any - can't remember) security vulnerabilities than Dixie's crond *and* what's more, it has a good man page with examples where as Dixie's crond does not. The only thing dcron does not support (iirc) is cron.{allow,deny} but even when I used to manage shell servers, I never found this to be a problem. When ever I have to work out a cron job on a Red Hat box or anything other than Slackware, I always login to my Slackware box to check out the examples from dcron's man page. -- Stuart Winter www.interlude.org.uk & www.armedslack.org | "Washing machines live longer with Calgon" |
| |||
| chris dunn wrote: > Dillon's Cron (and every other cron as far as I can see) > seems slightly backward in its abilities. You may be thinking about it wrong; In particular, you may be trying to do things that cron isn't intended for ... > It can't accommodate a one-off task in a following year. That's right, but at(1) can. > It can't accept dates such as "third sunday in month" or > "last day" or "first monday", all of which can be useful > at times. For these, you may need to do some shell script magic, to get your cron job to run exactly when you want, then have it called more frequently (weekly, daily, etc) than it will actually do any work. First Monday of the month, though is still pretty easy: It will be the only Monday that falls between the 1st and 7th of the month. Your job runs on Mondays, and checks that the date is less than 8 before doing any work. "Last day" can also be done easily in the called script itself, (check the date tomorrow; if it's the 1st, then today is the last day of the month), or you can use 3 lines in the crontab for the one job, if you don't mind February jobs not always falling on exactly the last day. Third Sunday in the month is a little tougher, and I would propose that this could be determined with some reasonably skillful shell programming. > Does anybody know an alternative that will accept these > scheduled times? Well, I hope that the above suggestions help ... -- ---------------------------------------------------------------------- Sylvain Robitaille syl@alcor.concordia.ca Systems analyst Concordia University Instructional & Information Technology Montreal, Quebec, Canada ---------------------------------------------------------------------- |
| |||
| * Stuart Winter <use.reply.to@interlude.org.uk>: [ ... ] > Also, dcron has suffered less (if any - can't remember) security > vulnerabilities than Dixie's crond *and* what's more, it has a good [ ... ] I think that you mean Vixie's crond rather than Dixie's crond. Well, I've never heard of the latter, at least, despite living in the Southern US. ;-) -- James Michael Fultz <xyzzy@sent.as.invalid> Remove this part when replying ^^^^^^^^ |
| |||
| On Thu, 30 Sep 2004 01:27:21 GMT, xyzzy@sent.as.invalid wrote: >> Also, dcron has suffered less (if any - can't remember) security >> vulnerabilities than Dixie's crond *and* what's more, it has a good > [ ... ] > > I think that you mean Vixie's crond rather than Dixie's crond. Well, > I've never heard of the latter, at least, despite living in the Southern > US. ;-) Paul Vixie - yes, vixie cron :-) -- Stuart Winter www.interlude.org.uk & www.armedslack.org | "Washing machines live longer with Calgon" |
| |||
| On Wed, 29 Sep 2004 08:07:09 -0400, chris dunn <paledread@linuxmail.org> wrote: >Dillon's Cron (and every other cron as far as I can see) >seems slightly backward in its abilities. > >It can't accommodate a one-off task in a following year. > >It can't accept dates such as "third sunday in month" or >"last day" or "first monday", all of which can be useful >at times. > >Does anybody know an alternative that will accept these >scheduled times? > >Kalarm doesn't get it done because it only runs when >someone is logged in, You may want to look at fcron. http://fcron.free.fr buck |
| |||
| Once upon a time, chris dunn <paledread@linuxmail.org> said: > >Does anybody know an alternative that will accept these >scheduled times? It might be overkill, but if you're looking for a "everything including the kitchen sink" alternative, there's GNU/cfengine: http://www.cfengine.org It's essentially an administration bot that allows you to describe a policy for how a system is to be run (including permissions, daemons, tripwires, mountpoints, etc) and then periodically checks everything to make sure it's right. But it can also be used as a more-featureful cron, with all the scheduling options your heart desires. -- TTK |
| |||
| On 2004-09-29, Sylvain Robitaille <syl@alcor.concordia.ca> wrote: > chris dunn wrote: > >> Dillon's Cron (and every other cron as far as I can see) >> seems slightly backward in its abilities. > > You may be thinking about it wrong; In particular, you may be trying to > do things that cron isn't intended for ... > >> It can't accommodate a one-off task in a following year. > > That's right, but at(1) can. > >> It can't accept dates such as "third sunday in month" or >> "last day" or "first monday", all of which can be useful >> at times. > > For these, you may need to do some shell script magic, to get your cron > job to run exactly when you want, then have it called more frequently > (weekly, daily, etc) than it will actually do any work. > > First Monday of the month, though is still pretty easy: It will be the > only Monday that falls between the 1st and 7th of the month. Your job > runs on Mondays, and checks that the date is less than 8 before doing > any work. > > "Last day" can also be done easily in the called script itself, (check > the date tomorrow; if it's the 1st, then today is the last day of the > month), or you can use 3 lines in the crontab for the one job, if you > don't mind February jobs not always falling on exactly the last day. > > Third Sunday in the month is a little tougher, and I would propose > that this could be determined with some reasonably skillful shell > programming. > >> Does anybody know an alternative that will accept these >> scheduled times? > > Well, I hope that the above suggestions help ... Thanks for this. It all falls into place with some additional scripting. Perfect. |
| ||||
| A few days ago, I wrote in a followup message to Chris Dunn: > Third Sunday in the month is a little tougher, and I would propose > that this could be determined with some reasonably skillful shell > programming. I've whipped together a possible solution to this. I have to admit it seems rather kludgy, and I'm sure it could be done even more elegantly, but this at least works on any UNIX or UNIX-like system, even with only a basic installation. You've been warned, though: this isn't pretty ... A simple script follows that uses my solution ... #!/bin/sh # Test script to see if today is the third Sunday of the month ... if [ `date +%d` -eq `cal|egrep '^ ?[0-9]'|awk 'NR==3 {print $1}'` ] then echo "Today is the third Sunday of the month" fi -- ---------------------------------------------------------------------- Sylvain Robitaille syl@alcor.concordia.ca Systems analyst Concordia University Instructional & Information Technology Montreal, Quebec, Canada ---------------------------------------------------------------------- |