Skip to content

Conversation

@masa-08
Copy link
Contributor

@masa-08 masa-08 commented Feb 16, 2023

resolve #487

This PR will implement the feature discussed in the above issue.

To summarize this issue

  • The functionality to schedule on a monthly or yearly unit is needed.
  • Considering the job persistence that @gabrielcipriano points out, we should not simply add the functionality to schedule on a monthly or yearly unit.
  • In light of these considerations, it is desirable to design the system to allow scheduling on a monthly or yearly unit as long as the specific dates are specified, which is the idea of @ttamg.

Therefore, I have implemented the feature that allows scheduling on a monthly or yearly unit by specifying a specific date.

This feature can be used as follows

# Run jobs on the 5th of each month.
schedule.every().date("05").do(job)
# Run jobs at 9:00 on Dec 5th every two years.
schedule.every(2).date("12/05").at("09:00").do(job)

Your review and comments would be greatly appreciated.

@masa-08 masa-08 changed the title Add the functionality to run jobs at specified intervals on specific dates Add the functionality to run jobs at monthly or yearly intervals on specific dates Feb 16, 2023
@c0d3rman
Copy link

c0d3rman commented Oct 1, 2023

Any progress on merging this? I also need this functionality.

@detheavn
Copy link

I agree monthly and yearly would be great additions, but I would like to make an additional suggestion for the monthly, namely the first and last of the month with offsets:
.firstof() would then be the 1st of the month
.lastof() would be the last of the month.

Offsets could then be done as follows:
.firstof(1) would then be the 2nd of the month
.lastoff(1) would then be the day before the last day of the month.

@Benjythebee
Copy link

bump, PR becoming stale?

@NicholasBHubbard
Copy link

NicholasBHubbard commented Nov 13, 2024

Any updates on this? I would also benefit from this functionality. Anything I can do to help?

@Kugeleis
Copy link

Kugeleis commented Jan 6, 2025

Here is a use case: Run only in Winter (e.g. November trough March) daily 8 am.
It would be great if schedule could cover this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

supports "months" and "years” interval

6 participants