lists.openmoko.org at wongs.net
Sun May 31 01:54:44 CEST 2009
Did you try $cron->get_next_execution_time($cron_entry,[$ref_time]) ?
On Sat, May 30, 2009 at 4:21 PM, Ed Kapitein <ed at kapitein.org> wrote:
> Alexey Feldgendler wrote:
>> On Fri, 29 May 2009 15:49:27 +0200, Ed Kapitein <ed at kapitein.org> wrote:
>>> i need a script/program that will read a crontab line
>>> ( * * * * * some_action) and output the date and time the job will run.
>>> Does anyone know of such a tool?
>>> This way i can un-suspend the FR a few seconds prior to the start of
>>> that cron job.
>>> I already made a script that sort of works, but it is limmited at best
>>> and i hate to reinvent the wheel again.
>> You might want to look at this:
> Hi Alexey and all the others
> I did take a look at perl, but i am a real perl noob.
> This is what i have so far:
> use Config::Crontab
> $event = new Config::Crontab::Event( -data => '*/5 3 * * 5,6 /bin/blech' );
> print $event->minute . "\n";
> print $event->hour . "\n";
> print $event->dom . "\n";
> print $event->datetime . "\n";
> print $event->command . "\n";
> print $event->dump . "\n";
> And if i run that i get:
> */5 3 * * 5,6
> */5 3 * * 5,6 /bin/blech
> Perhaps i am missing the obvious here.
> Is there someone out there who can make a script that can read a
> crontab line and give the time and date of the next time it will be
> executed ?
> output in the form:
> secs_since_epoch,yyyy-mm-dd,hh:mm,command would be *great*
> Many thanks in advance,
> Openmoko community mailing list
> community at lists.openmoko.org
More information about the community