crontab says "at this freq." and then gives two points, not a frequency #124

Closed
majuscule opened this Issue Sep 26, 2012 · 27 comments

Comments

Projects
None yet
6 participants
Contributor

elohmrow commented Feb 8, 2014

i can work on this next week if no one else is yet; just let me know.

Member

mintsoft commented Feb 8, 2014

@elohmrow go for it!

Owner

jagtalon commented Feb 11, 2014

@elohmrow Nice--just ask us if you have any questions!

Contributor

elohmrow commented Feb 12, 2014

I'll work this tomorrow :)

sent by a bradDroid - please expect bradVity!
On Feb 11, 2014 6:20 PM, "Jag Talon" notifications@github.com wrote:

@elohmrow https://github.com/elohmrow Nice--just ask us if you have any
questions!


Reply to this email directly or view it on GitHubhttps://github.com/duckduckgo/zeroclickinfo-goodies/issues/124#issuecomment-34820985
.

Contributor

elohmrow commented Feb 13, 2014

ok, i just took a look at this.

what exactly do we want it to do?

right now, the description says:
'show the next occurance of a cron job in human-readable form'

but then the output gives us a "frequency" along with the next N (where N has been hard-coded to be 3) occurrences.

if we want it to simply show the next N occurrences, then this is as simple as changing the output verbiage.

if we in stead want a human-readable frequency (e.g., "this job will run every 5 minutes on the 3rd friday of every month"), then there's more work here than 5 minutes.

i'll go whichever way is best - lemme know your thoughts!

Member

mintsoft commented Feb 13, 2014

@elohmrow I think the problem is that it says "at this frequency" implying "every 5 minutes", but instead gives examples of the frequency.

Personally I think output like "Every 5 minutes starting at 00:02 (00:02, 00:07, 00:12...)" would be the ideal.

@nospampleasemam did you have anything particular in mind?

Owner

moollaza commented Mar 17, 2014

ping.

Any progress on this guys?

@moollaza moollaza removed the Improvement label Mar 17, 2014

Contributor

elohmrow commented Mar 17, 2014

I started changing it several weeks ago, but there was some confusion as to
what exactly needed to be done.

sent by a bradDroid - please expect bradVity!
On Mar 17, 2014 4:16 PM, "Zaahir Moolla" notifications@github.com wrote:

ping.

Any progress on this guys?


Reply to this email directly or view it on GitHubhttps://github.com/duckduckgo/zeroclickinfo-goodies/issues/124#issuecomment-37864610
.

Owner

moollaza commented Mar 18, 2014

@elohmrow I think your suggestion,

if we in stead want a human-readable frequency (e.g., "this job will run every 5 minutes on the 3rd friday of every month"), then there's more work here than 5 minutes.

sounds like the best idea as making the cron job human-readable and easy to understand seems to be the goal of this IA -- or at least that's what I would use it for :)

Contributor

elohmrow commented Mar 18, 2014

Sounds good ... I'll look at it this week :)

sent by a bradDroid - please expect bradVity!
On Mar 18, 2014 2:38 PM, "Zaahir Moolla" notifications@github.com wrote:

@elohmrow https://github.com/elohmrow I think your suggestion,

if we in stead want a human-readable frequency (e.g., "this job will run
every 5 minutes on the 3rd friday of every month"), then there's more work
here than 5 minutes.

sounds like the best idea as making the cron job human-readable and easy
to understand seems to be the goal of this IA -- or at least that's what I
would use it for :)


Reply to this email directly or view it on GitHubhttps://github.com/duckduckgo/zeroclickinfo-goodies/issues/124#issuecomment-37971459
.

Contributor

elohmrow commented Mar 24, 2014

@moollaza - i managed to find some (huge) code for translating (what looks like) every cronfile version here: http://www.cpan.org/authors/id/S/SB/SBURKE/crontab2english_0.71.pl.

after making some minor changes, this seems to be what we would want:

bradley@li239-109:/C2E$ cat cron1
* */3 * * * blah
bradley@li239-109:/C2E$ ./c2e.pl cron1
This cron job will run: Every minute of every third hour of every day
bradley@li239-109:/C2E$ cat cron2
42 12 3 Feb Sat blah
bradley@li239-109:/C2E$ ./c2e.pl cron2
This cron job will run: 12:42pm on the third of -- or every Saturday in -- February
bradley@li239-109:~/C2E$

The issue is the (huge) bit. The author never converted this to a module, so it's this 1,000 line monster.

My thinking is this: I can modify this a bit more, then add this 1,000 lines to the existing script for now, then convert this cron2english script into a module, and later #include that and then remove that 1,000 lines from the goodie. This script seems to be very tight, and does a lot more (and more closely matches what we want to do with this goodie) than the previous include.

Thoughts?

Owner

moollaza commented Mar 25, 2014

@elohmrow that sounds like a good plan, good find!

I don't mind the Goodie being huge, but of course it's much cleaner if we can just use a module.

Contributor

elohmrow commented Mar 25, 2014

Okey, will do tomorrow ... I'll just module it up.

sent by a bradDroid - please expect bradVity!
On Mar 25, 2014 3:34 PM, "Zaahir Moolla" notifications@github.com wrote:

@elohmrow https://github.com/elohmrow that sounds like a good plan,
good find!

I don't mind the Goodie being huge, but of course it's much cleaner if we
can just use a module.


Reply to this email directly or view it on GitHubhttps://github.com/duckduckgo/zeroclickinfo-goodies/issues/124#issuecomment-38610172
.

Contributor

elohmrow commented Mar 31, 2014

@moollaza had a chat with the author of that perl script after i proclaimed i'd do this ... he claims his work is not yet ready for prime time, and that it can be, but should not be used. he wants to run through it again at some point and make sure it meets all possible changes to cron files since he last looked at it.

IMO, what he has is far superior to what we currently are using, so ... i still plan to turn it into a module ... will do today, and then convert the goodie to use said module.

Contributor

elohmrow commented Mar 31, 2014

@moollaza okey, this is working now locally, using a module. once the module is accepted up to CPAN, I will commit to DDG for use.

Owner

moollaza commented Apr 5, 2014

@elohmrow sorry for the delay -- this looks great, much simpler! Is ParseCron on CPAN now? Go ahead and make a PR if it is :)

Thanks again!

Contributor

elohmrow commented Apr 8, 2014

@moollaza yes, you can do a cpan install ParseCron now. i'm pretty busy until this weekend, so i may not be able to open a PR until then.

Owner

moollaza commented Apr 8, 2014

@elohmrow excellent. That's no problem, there's no rush :)

Contributor

elohmrow commented Jul 8, 2014

whatever happened to this?

doesn't look like it was pushed up yet.

Owner

jagtalon commented Jul 22, 2014

@elohmrow Nice! Please make a PR for it. :)

Contributor

elohmrow commented Jul 22, 2014

it seems i forgot to do that, eh?!

i'll have to look later at the LOE involved, since it has been such a long
time

On Tue, Jul 22, 2014 at 1:36 PM, Jag Talon notifications@github.com wrote:

@elohmrow https://github.com/elohmrow Nice! Please make a PR for it. :)


Reply to this email directly or view it on GitHub
#124 (comment)
.

Owner

jagtalon commented Jul 22, 2014

@elohmrow Thanks!

Contributor

elohmrow commented Jul 22, 2014

@moollaza @jagtalon - PR submitted as #558

Owner

jagtalon commented Jul 29, 2014

@elohmrow I see! Reopen it if you're ready, :)

Contributor

W25 commented Dec 30, 2014

I wrote a parser for crontab format similar to crontab2english and the CPAN module ParseCron. Your comments and suggestions are welcomed. #885

Member

mintsoft commented Jan 10, 2015

Fixed by @W25 in #885

@mintsoft mintsoft closed this Jan 10, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment