How can I schedule a jenkins job every hour

8,776

The highest voted answer here is incorrect: Need to schedule a job every hour in jenkins

The right way to do this effectively is as follows:

  1. If you already have/or plan to have multiple Jenkins jobs that you trigger periodically

    a. If you want to schedule a job every hour but don't mind specifically on which minute it triggers then in order to produce an even load on Jenkins at all times use the automatic load balancing mechanism for scheduling the job (H) in the Jenkins cron expression which will cause the job to trigger pseudo randomly every hour:

    • @hourly

      Alternatively:
    • H * * * *
    • H */1 * * *


    NB: Don't do this! (in Jenkins v2.89.3 or below)


    b. If you want to schedule on a specific minute every hour (e.g. :30) then add a small range (e.g. +/- 5 mins) to minimise the load on the system:

    • H(30-35) * * * *


    2. If you will only ever have a single Jenkins job that you wish to trigger periodically

    To schedule on a specific minute (e.g. :30) then lock it down as follows:

    • 30 * * * *
Share:
8,776

Related videos on Youtube

Anthony
Author by

Anthony

Updated on September 18, 2022

Comments

  • Anthony
    Anthony over 1 year

    I'm New to Jenkins. I have a job which i need to schedule every 1 hour.

    I am using

    * */1 * * * 
    

    but it is not working effectively.

    Please provide any other solution.  

    • fixer1234
      fixer1234 over 6 years
      This isn't just a duplicate, it's a plagiarized question.