Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Configure hudson/jenkins to run at 6:00PM and 1 AM every day

Tags:

jenkins

hudson

I need to able to configure every 6PM and 1 AM in build periodically section, any examples could you pass on?

like image 894
sharp Avatar asked Aug 14 '11 07:08

sharp


People also ask

How do I schedule a Jenkins job to run at a specific time?

Add a Schedule to a Jenkins JobHead back to the job configuration and click the Build Triggers tab. Now, check the Build periodically box in the Build Triggers section. This will open the scheduling text area. Next, let's set the job to run every five minutes.

What is the meaning of * * * * * In the schedule text box of the build trigger section?

In the Build Triggers section, instead of selecting Build Periodically, let's select Poll SCM. As soon as we do that, we should see a text box with Label Schedule. Let's type */5 * * * * in this box, which means we want to schedule the job to run every 5 minutes: Let's scroll up to Source Code Management section.

How do I schedule a cron job in Jenkins?

CRON in JenkinsIn the Jenkins job's “Configure” option, we'll want to navigate to the “Build Trigger” tab, where we'll see the checkboxes for “Poll SCM” and “Build Periodically.” These are the options where we must be familiar with CRON syntax and its function to configure our Jenkins Build.

How do I schedule a Jenkins build?

Press the "Schedule Build" link on the project page or use the schedule build action in the list view. Then select date and time when to schedule the build. The build will be added to the build queue with the respective quiet period.


2 Answers

Each Job has a Build Trigger section where you can configure to Build periodically. The syntax is cron-like so you have to add 0 1,18 * * * to build at 1AM and 6PM.

like image 112
MOnsDaR Avatar answered Nov 01 '22 06:11

MOnsDaR


Another Alternative is like H(0-0) 1-18 * * *

Jenkins cron has following syntax

1 Parameter - Minutes in one hour (0-59)
2 Parameter - HOURS Hours in one day (0-23)
3 Parameter - DAYMONTH Day in a month (1-31)
4 Parameter - MONTH Month in a year (1-12)
5 Parameter - DAYWEEK Day of the week (0-7)
like image 10
Cyborgz Avatar answered Nov 01 '22 06:11

Cyborgz