Reputation: 1413
I'm looking for an APScheduler trigger that will execute a job every nth day of a month. For example, I want to run a job on the first Tuesday of every month. Or on the first and third Monday of every month.
Does anyone have a trigger that accomplishes this? You can almost do it with the cron scheduler and having your function double-check that it's running at the right time: Cron job to run every first or last chosen day of week of every month
Upvotes: 2
Views: 6137
Reputation: 5901
Using the documentation of the cron trigger:
scheduler.add_job(func, 'cron', day='1st tue')
scheduler.add_job(func, 'cron', day='1st mon,3rd mon')
scheduler.add_job(func, 'cron', day='1st fri,last fri')
Upvotes: 7