crontab library
Hello, is anyone aware of a crontab library. Possibly even more complete, something that will let me create/manipulate/delete crontab entries in a nice way and install the new crontab accordingly. I had a look at the crontab docs and never realized how complex it actually is. So before I spend time in creating such a thing maybe someone did it already :) thanks martin -- http://noneisyours.marcher.name http://feeds.feedburner.com/NoneIsYours -- http://mail.python.org/mailman/listinfo/python-list
Re: crontab library
2007/10/24, Martin Marcher [EMAIL PROTECTED]: Hello, is anyone aware of a crontab library. Possibly even more complete, something that will let me create/manipulate/delete crontab entries in a nice way and install the new crontab accordingly. I had a look at the crontab docs and never realized how complex it actually is. So before I spend time in creating such a thing maybe someone did it already :) When you say complex, are you talking about the possible ways to define when your job runs ? You could use a parser for the time format it uses, like this: http://umit.svn.sourceforge.net/viewvc/umit/branch/ggpolo/umitCore/CronParser.py?revision=1175view=markup I believe using this parser or some other would cut all the difficulty, then it is all about creating a gui/cli/etc based on it or extend it.. it is up to you =) thanks martin -- http://noneisyours.marcher.name http://feeds.feedburner.com/NoneIsYours -- http://mail.python.org/mailman/listinfo/python-list -- -- Guilherme H. Polo Goncalves -- http://mail.python.org/mailman/listinfo/python-list
Re: crontab library
2007/10/24, Guilherme Polo [EMAIL PROTECTED]: 2007/10/24, Martin Marcher [EMAIL PROTECTED]: I had a look at the crontab docs and never realized how complex it actually is. So before I spend time in creating such a thing maybe someone did it already :) When you say complex, are you talking about the possible ways to define when your job runs ? You could use a parser for the time format it uses, like this: http://umit.svn.sourceforge.net/viewvc/umit/branch/ggpolo/umitCore/CronParser.py?revision=1175view=markup This looks nice for starters. But the crontab(5) manpage has a lot more - that's what I meant by complex. I guess it's just quite some typing work :) * lists * 1,2,4 * ranges * 1-3 * steps * 1-12/2 * */3 * specials * @annually * @weekly * @daily * ... * mixes there of * 1-4,6,16-22/3 (this actually depends on which cron you use, the lowest common denominator would be to use either lists or ranges (or ranges with steps)) Then there is the difference of roots crontab where whe have a line like this: # minute hour dom month dow user command 0 * * * * nobody echo foo A users crontab # minute hour dom month dow command 0 * * * * echo foo and all the variables one could use. with a few of them being mandatory (LOGNAME, or USER depending on the OS), some of them being standard variables (SHELL, PATH) and of course custom variables. -- http://noneisyours.marcher.name http://feeds.feedburner.com/NoneIsYours -- http://mail.python.org/mailman/listinfo/python-list
Re: crontab library
2007/10/24, Martin Marcher [EMAIL PROTECTED]: 2007/10/24, Guilherme Polo [EMAIL PROTECTED]: 2007/10/24, Martin Marcher [EMAIL PROTECTED]: I had a look at the crontab docs and never realized how complex it actually is. So before I spend time in creating such a thing maybe someone did it already :) When you say complex, are you talking about the possible ways to define when your job runs ? You could use a parser for the time format it uses, like this: http://umit.svn.sourceforge.net/viewvc/umit/branch/ggpolo/umitCore/CronParser.py?revision=1175view=markup This looks nice for starters. But the crontab(5) manpage has a lot more - that's what I meant by complex. I guess it's just quite some typing work :) * lists * 1,2,4 * ranges * 1-3 * steps * 1-12/2 * */3 It supports all these, so your complex argument was cut down again. * specials * @annually * @weekly * @daily * ... These specials aren't really complex, it is just some pre-sets * mixes there of * 1-4,6,16-22/3 Supports too, complexity is over again (this actually depends on which cron you use, the lowest common denominator would be to use either lists or ranges (or ranges with steps)) Then there is the difference of roots crontab where whe have a line like this: # minute hour dom month dow user command 0 * * * * nobody echo foo A users crontab # minute hour dom month dow command 0 * * * * echo foo For this you basically check how many fields it has, so you can determine if there is an user especified or not. and all the variables one could use. with a few of them being mandatory (LOGNAME, or USER depending on the OS), some of them being standard variables (SHELL, PATH) and of course custom variables. If you need to use these you should know how to use these, just write them and let the crontab app handle it. -- http://noneisyours.marcher.name http://feeds.feedburner.com/NoneIsYours -- http://mail.python.org/mailman/listinfo/python-list -- -- Guilherme H. Polo Goncalves -- http://mail.python.org/mailman/listinfo/python-list