How to make your laravel command run two days in a week and twice a day? - laravel-5.1

I have a laravel 5 app. I want to run a laravel command twice a day in two days of the week. My attempt is as follows:
$schedule->command('supervisor:reminder')->weekly()->mondays()->thursdays()->twiceDaily(6, 13);
I don't get the reminder emails. What could be wrong?

Using the command below,my application is sending notifications to managers on Mondays and Thursdays at 7AM and 2PM.
$schedule->command('manager:reminder')->cron('0 6,13 * * 1,4');

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.

JQL to get no of open issues on start day of week in past and no of closed issues at end day of that week

I am new to jql and puzzled on how to write jql query for this .
I want to get all open issues on start of N'th week in past and no of all issues closed by end of that week.
e.g . 3rd week in past , my week start day is monday morning and ends at sunday night. i want to get no of open issues on beginning monday morning , and no of all issues closed on end of the day sunday for that week
You can use the WAS operator with an ON constraint like the following:
status was open on "2020-01-01"
Instead of a fixed date you can also use the JQL functions startOfWeek() and endOfWeek, but be carefull start of week and end of week may depend on the configured locale.

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

Jenkins auto build is not working

This is ramesh,
I tried to build my .net application using jenkins, my source is reside at in github. I can get build, when using manual build option in jenkins. But auto build is not working, when i give commit on github.
Thanks
Your question is not clear. What are you Build triggers?
Here's what I use:
Jenkins uses something called corn expressions
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
* */23 * * * == one day

Run jenkins job periodically

I want to execute a python script once in a day at say 1 PM.
I tried using * 13 * * * but the script did not execute automatically.
You should use the Build periodically option as below:
H(0-6) ****
you should use the hours option **** means every day in every week of every month of every year during 0-6 hours this worked perfectly for me
Answer :
H(0-10) 13 * * *
How do you know it didn't execute? Normally it will send a mail to the user account authorised to run the script - look under /var/mail/$ACCOUNT and you should see if it ran, but failed...
I hope you are trying to run the build at 1 PM every day. You can use the below in this case and try.
0 13 1-31 1-12 0-7

Resources