用于计划作业的Perl模块-类似于cron的位

用于计划作业的Perl模块-类似于cron的位,perl,cron,Perl,Cron,我开始编写一个模块,用比cron作业更可读的语法来调度perl作业,但我想知道是否已经有了一个可用的模块 我想要的是可以从perl脚本而不是crontab文件运行的东西。这种语法必须易于阅读。例如:- every Monday morning every other Tuesday at 3:30pm every night once only on 14th August 2010 at 2pm …如果有哪怕是一点点类似的东西,那就太好了。我快速查看了CPAN,但找不到我想要的东西。看起来C

我开始编写一个模块,用比cron作业更可读的语法来调度perl作业,但我想知道是否已经有了一个可用的模块

我想要的是可以从perl脚本而不是crontab文件运行的东西。这种语法必须易于阅读。例如:-

every Monday morning
every other Tuesday at 3:30pm
every night
once only on 14th August 2010 at 2pm
…如果有哪怕是一点点类似的东西,那就太好了。我快速查看了CPAN,但找不到我想要的东西。

看起来CPAN就是这样做的。不幸的是,文档几乎不存在。从我找到的模块自检文件中剔除:

{ '9 in the evening'                => '24.11.2006 21:00:00' },
{ 'monday 6 in the morning'         => '20.11.2006 06:00:00' },
{ 'monday 4 in the afternoon'       => '20.11.2006 16:00:00' },
{ 'monday 9 in the evening'         => '20.11.2006 21:00:00' },
{ 'last sunday at 21:45'            => '19.11.2006 21:45:00' },
{ 'monday last week'                => '13.11.2006 00:00:00' },
{ '6th day last week'               => '18.11.2006 00:00:00' },
{ '6th day this week'               => '25.11.2006 00:00:00' },
{ '6th day next week'               => '02.12.2006 00:00:00' },
{ '12th day last month'             => '12.10.2006 00:00:00' },
{ '12th day this month'             => '12.11.2006 00:00:00' },
{ '12th day next month'             => '12.12.2006 00:00:00' },
{ '1st day last year'               => '01.01.2005 00:00:00' },
{ '1st day this year'               => '01.01.2006 00:00:00' },
{ '1st day next year'               => '01.01.2007 00:00:00' },
这看起来很有希望。

看起来CPAN就是这么做的。不幸的是,文档几乎不存在。从我找到的模块自检文件中剔除:

{ '9 in the evening'                => '24.11.2006 21:00:00' },
{ 'monday 6 in the morning'         => '20.11.2006 06:00:00' },
{ 'monday 4 in the afternoon'       => '20.11.2006 16:00:00' },
{ 'monday 9 in the evening'         => '20.11.2006 21:00:00' },
{ 'last sunday at 21:45'            => '19.11.2006 21:45:00' },
{ 'monday last week'                => '13.11.2006 00:00:00' },
{ '6th day last week'               => '18.11.2006 00:00:00' },
{ '6th day this week'               => '25.11.2006 00:00:00' },
{ '6th day next week'               => '02.12.2006 00:00:00' },
{ '12th day last month'             => '12.10.2006 00:00:00' },
{ '12th day this month'             => '12.11.2006 00:00:00' },
{ '12th day next month'             => '12.12.2006 00:00:00' },
{ '1st day last year'               => '01.01.2005 00:00:00' },
{ '1st day this year'               => '01.01.2006 00:00:00' },
{ '1st day next year'               => '01.01.2007 00:00:00' },

这看起来很有希望。

符合您的要求。

符合您的要求。

谢谢,尽管这看起来只是日期格式方面的问题。不是查看此格式的计划程序。文档对我来说很好:@Kinopiko:同意,这不是我看到的页面,因为我不再是JAPH.:/谢谢你提供了正确的链接。谢谢,虽然这看起来只是日期格式方面的问题。不是查看此格式的计划程序。文档对我来说很好:@Kinopiko:同意,这不是我看到的页面,因为我不再是JAPH.:/感谢您提供了正确的链接。它没有自然日期格式,只有普通的crontab日期。@道尔顿:是的,您必须使用其他模块(如msw显示的DateTime::Format系列中的某些模块)。它没有自然日期格式,只有普通的crontab日期。@dalton:是的,您必须使用其他模块(就像msw显示的DateTime::Format系列中的某些内容)。