Run every 2nd and 4th Saturday of the month

前端 未结 5 1077
执念已碎
执念已碎 2020-12-16 00:21

What\'s the cron (linux) syntax to have a job run on the 2nd and 4th Saturday of the month?

5条回答
  •  孤街浪徒
    2020-12-16 00:58

    What about having two jobs

    0 0 0 ? * 7#2
    0 0 0 ? * 7#4
    

    The first one gives

    2015-12-12 00:00:00 (-08:00)
    2016-01-09 00:00:00 (-08:00)
    2016-02-13 00:00:00 (-08:00)
    2016-03-12 00:00:00 (-08:00)
    2016-04-09 00:00:00 (-07:00)
    

    And the second one gives

    2015-11-28 00:00:00 (-08:00)
    2015-12-26 00:00:00 (-08:00)
    2016-01-23 00:00:00 (-08:00)
    2016-02-27 00:00:00 (-08:00)
    2016-03-26 00:00:00 (-07:00)
    

提交回复
热议问题