Scheduling your first job

Scheduling your first job

Scheduling jobs in Jenkins is very simple and easy. First of all, let's create a simple job. Go to the main screen.

Screenshot

Now click on New Job. That should take you to screen below. Give the job a name and click on OK.

Screenshot

Okay, now you have to find the Build Triggers section and check the box that says Build periodically. There will appear a box where you can schedule jobs using a CRON-like syntax.

You can also include build steps. Try adding one that executes a shell script that prints the current date.

In the example below, it says to schedule the job to be executed every 5 minutes.

Screenshot

If you pay attention to your build history, with time you'll realize builds are being executed every 5 minutes, just like you scheduled.

Screenshot

And checking the console output you can see the results of your job, and who/when triggered its execution.

Screenshot

There are many ways to schedule a job in Jenkins. You can use the web interface, the command line CLI, the REST API or use plug-ins for that. Try reading the Jenkins Wiki and looking for other ways to schedule jobs.