Run every 2nd and 4th Saturday of the month

前端 未结 5 1054
执念已碎
执念已碎 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:59

    The above solution works well. In addition, I had a more complicated challenge where I have multiple sets of scripts and each set depended on the other. The first set of scripts had to run on the 3rd Sunday of the month. The 2nd set of scripts on the Monday following the 3rd Sunday of the month, and so forth. The solution I came up with, building on the above solution, is the following:

    3rd Sunday date 15-21.

    Monday after 3rd Sunday date 16-22.

    Tuesday after 3rd Sunday date 17-23.

    The other date ranges are offset by the number of days difference from the first set of scripts, which are the triggering scripts.

提交回复
热议问题