我希望为我设置三个脚本的cron时间表提供一些帮助。我需要安排第一个脚本在每个月的第一个星期二运行,第二个脚本运行在每个月的第二个星期二,第三个脚本运行在每个月的第三个星期二。这是迄今为止我所拥有的。安排一个cron作业在每个月的第一,第二和第三个星期二运行
# Run first script on the 1st Tuesday of every month at 9:00 AM
0 9 1,2,3,4,5,6,7 * 2 wget -q -O /dev/null http://site.com/first-script
# Run second script on the 2nd Tuesday of every month at 9:00 AM
0 9 8,9,10,11,12,13,14 * 2 wget -q -O /dev/null http://site.com/second-script
# Run third script on the 3rd Tuesday of every month at 7:00 AM
0 7 15,16,17,18,19,20,21 * 2 wget -q -O /dev/null http://site.com/third-script
我相信这些脚本将在第一,第二,和每月的第三个星期二和每月的1-21日运行。从我读过的一周中的日子看来,日子是一个AND,这是真的吗?
希望这是可能的w/cron,否则我将不得不将决定运行脚本或不在脚本本身。
很酷,谢谢。我想我会转移逻辑来确定每个星期二的PHP主要脚本,并简单地安排一个cron按照您的建议在每个星期二运行。谢谢! – scottystang