Skip Menu |

This queue is for tickets about the Set-Crontab CPAN distribution.

Report information
The Basics
Id: 25923
Status: open
Priority: 0/
Queue: Set-Crontab

People
Owner: Nobody in particular
Requestors: krishnoid [...] wapacut.com
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: 1.00
Fixed in: 1.00



Subject: handy to use month/dow names per crontab(5)
From crontab(5) under ubuntu 6.10 (edgy eft): Show quoted text
> Names can also be used for the 'month' and 'day of week' fields. Use > the first three letters of the particular day or month (case doesn't > matter). Ranges or lists of names are not allowed.
A quick modification that implements this (without a great deal of testing) is: %calnametonum = qw(jan 1 feb 2 mar 3 apr 4 may 5 jun 6 jul 7 aug 8 sep 9 oct 10 nov 11 dec 12 mon 1 tue 2 wed 3 thu 4 fri 5 sat 6 sun 7); $calregexp = '(' . join('|', keys %calnametonum) . ')'; # ... collect cron specification $cronspec = lc $cronspec; $cronspec =~ s/$calregexp/$calnametonum{$1}/gi; # ... continue to handle cron spec as usual It's much more lax in input checking, but should handle all legal cases per the crontab(5) man page. Perhaps this doesn't belong in this module, but that's up to your discretion.
From: krishnoid [...] wapacut.com
From crontab(5) under ubuntu 6.10 (edgy eft): Show quoted text
> Names can also be used for the 'month' and 'day of week' fields. Use > the first three letters of the particular day or month (case doesn't > matter). Ranges or lists of names are not allowed.
A quick modification that implements this (without a great deal of testing) is: %calnametonum = qw(jan 1 feb 2 mar 3 apr 4 may 5 jun 6 jul 7 aug 8 sep 9 oct 10 nov 11 dec 12 mon 1 tue 2 wed 3 thu 4 fri 5 sat 6 sun 7); $calregexp = '(' . join('|', keys %calnametonum) . ')'; # ... collect cron specification $cronspec = lc $cronspec; $cronspec =~ s/$calregexp/$calnametonum{$1}/gi; # ... continue to handle cron spec as usual It's much more lax in input checking, but should handle all legal cases per the crontab(5) man page. Perhaps this doesn't belong in this module, but that's up to your discretion.
Subject: Re: [rt.cpan.org #25923] handy to use month/dow names per crontab(5)
Date: Sat, 31 Mar 2007 06:34:46 +0530
To: "krishnoid [...] wapacut.com via RT" <bug-Set-Crontab [...] rt.cpan.org>
From: Abhijit Menon-Sen <ams [...] toroid.org>
At 2007-03-29 18:53:33 -0400, bug-Set-Crontab@rt.cpan.org wrote: Show quoted text
> > It's much more lax in input checking, but should handle all legal > cases per the crontab(5) man page. Perhaps this doesn't belong in > this module, but that's up to your discretion.
Thanks for the suggestion. I'll consider it. -- ams