sharepointsharepoint-2013timer-jobs

Is it possible to make a Yearly SharePoint timer job programmatically?


Even though I created a SharePoint timer job to run yearly. Once the timer job is executed manually through the central admin(After deploying it), the Schedule type changes to "Hourly". Then it gets executed hourly thereafter. Is it a bug in SharePoint 2013? What is the workaround for this problem?


Solution

  • I had to do the same thing and i found a solution in changing the schedule to daily.

    Just check on Execute if it is the right date. This also has the advantages, that you can log it ('Timer Job runs' or something similar) to the ULS and check if your job keeps running. I know, that it will run 365 times but only executes one time, but like i mentioned you can add a control mechanism. (And i had to execute on two days in a year so monthly wasn't an option)

    When you don't want to execute it daily, you can change it to Monthly. Yearly is not an option, so will still have to check the current date on execute.