cronjobs

Ed Kapitein ed at kapitein.org
Sun May 31 03:29:13 CEST 2009


Ben Wong wrote:
> Did  you try  $cron->get_next_execution_time($cron_entry,[$ref_time]) ?
>
> --Ben
>   
No, i had no idea i could !
But now that i try it i get:
Can't call method "get_next_execution_time" on an undefined value at
./ff.pl line 11.

Can you make an example perl script? a real simple one?

Thanks !

Kind regards,

Ed


> 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:
>>> http://search.cpan.org/dist/Schedule-Cron
>>>
>>>       
>> 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:
>>
>> #!/usr/bin/perl
>> 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 3 * * 5,6
>> /bin/blech
>> */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,
>>
>> Ed
>>
>>
>>
>> _______________________________________________
>> Openmoko community mailing list
>> community at lists.openmoko.org
>> http://lists.openmoko.org/mailman/listinfo/community
>>
>>     
>
> _______________________________________________
> Openmoko community mailing list
> community at lists.openmoko.org
> http://lists.openmoko.org/mailman/listinfo/community
>   





More information about the community mailing list