Schedule a Jenkins job everyday at 8:30 AM except on Friday - jenkins

I have a Jenkins job that runs every day at 8:30 AM.
I want the job not to run on Fridays. Is there a way to achieve this ?

You can use the dow (day of week) to achieve it:
30 8 * * 0-4,6 your_command
# 0=Sunday 6=Saturday

Related

Cron that runs on first Sunday after the first Friday of the month has passed

We work on a product whose software development team applies patch on every 1st Friday of the month. We have written some tests that we run on the Sunday after the patch is applied. So to automate the same on Jenkins, we would need a cron that runs on 1st Sunday after the 1st Friday of the month has passed.
Right now we just update our Jenkins each month considering dates, but can we automate this?
Thanks
Naively, one would suppose that 0 3 1-7 * fri would be "3am on the Friday that falls inside the first week of each month", and then we could use the similar logic to construct 0 3 3-9 * sun, for the Sunday that follows two days after such a Friday.
Unfortunately, this does not work, because day of week and day of month are taken as a disjunction by the cron specification; which means, the above would trigger not on the Sunday following the first Friday in a month, but on every Sunday, and also every day from 3rd to 9th.
Due to this twist in cron spec, what you ask is not possible by cron alone. The easiest way to untangle this is to separate the two requirements, ask the cron to track one of them, and manually test the other: either use 0 3 3-9 * * and then manually test in your script whether the day is Sunday and exit without performing your task if it is not, or use 0 3 * * sun and manually make sure the date is between 3rd and 9th.

Is there anyway/plugin we can trigger a build only at particular time and should not be able to trigger any other time?

I have created my job and want to trigger build daily at 11am and in any other time I should not be able to trigger it.
You can Go to “Build Triggers” section in jenkins and under that Check “Poll SCM”, here you can create cron jon for your pipeline trigger.
For you query you can give somethind like below in the Poll SCM schedule box:
0 11 * * *
Jenkins used a cron expression, and the different fields are:
MINUTES Minutes in one hour (0-59)
HOURS Hours in one day (0-23)
DAYMONTH Day in a month (1-31)
MONTH Month in a year (1-12)
DAYWEEK Day of the week (0-7) where 0 and 7 are sunday
For more info please visit here
To add on the given answer , you can also add a simple bash script to check the time and exit or do the same in the jenkins pipeline

Schedule a Jenkins job for future date

I have to schedule a Jenkins job which runs every Day of the week, every Month in a year , every Day in a month but after a specific date.
I have used the below cron expression but it will trigger the job only on 1:00 pm for sept month only.
0 13 * 8 *
I need to schedule it from Sept,01,2018 onward everyday at 1:00pm.
If You want to trigger in future use: Schedule Build Plugin
0 0 13 1 1/1 ? *
For more information you can visit www.cronmaker.com
Thanks,
Sunny

Jenkins schedule JOBS based on week

How do I schedule dependent jobs in Jenkins. I cant schedule it as 1st week , 2nd week or 3rd week to maintain the number of runs. We want the schedule weekly.
Job1 to run on week1
Job2 to run on week2
Job3 to run on week3
Again,
Job1 to run on week4
Job2 to run on week5
Job3 to run on week6.
And the schedule goes on ..
How do I script this in Jenkins "Build Periodically".
Thanks in advance.
I don't think you could do this with a cron expression. I think the best you could do is setup a weekly job and then use logic to execute the appropriate build.
You could either use a pipeline job, the conditional build step plugin, or if you really need them to be entirely separate jobs, build a pipeline job that runs weekly, decides which job to run, and then kicks off the appropriate job using the "build" step. You have much more powerful logic available to you this way, instead of just a cron expression.
This is the format to schedule jobs Weekly and Monthly
MINUTE (0-59), HOUR (0-23), DAY (1-31), MONTH (1-12), DAY OF THE WEEK (0-6)
Weekday daily build twice a day, at lunchtime 12:00 and midnight 00:00, Sunday to Thursday: 00 0,12 * * 0-4
Every first of every month between 2:00 a.m. - 02:30 a.m.: H(0,30) 02 01 * *

How to schedule jenkins to start every day between 6PM to 7AM and on frieday and saterday run every 30 minutes

I am trying to schedule a jenkins build with the following:
start every day between 6PM to 7AM and on Friday and Saturday run every 30 minutes... but it seems for some reason a little bit hard.
Any help will be appreciates.
So I used 2 different jobs:
first is:
H/30 * * * 5-6 - every hour at weekend (Friday and Saturday)
H/60 18,7 * * 0-5 - Every hour between 18:00 to 7:00 on working days
You can do this by checking "Build periodically" and entering the following:
# Run every thirty minutes for the 48 hours of Friday and Saturday
H/30 * * * 5-6
# Run once per hour, between 18:00 and 06:59, on Mon,Tue,Wed,Thu,Fri
H 18-6 * * 1-5
Note also that this second expression will not run from Friday 6pm until Saturday 7am — it will stop at midnight, and resume again on Monday morning between midnight and 7am.

Resources