laravel schedule task to run every 10 days of a month - laravel

I have a task which I need to execute for the first 10 days of every month
something like below:
$schedule->command('log:test')->cron('* * 1-10 * *');
seems cron() is not getting executed... though everyMinute() is working fine... How can I get this to work?

You have to fill the hour and minutes on the cron.
Try this one if you want it get executed at the start of the day.
$schedule->command('log:test')->cron('0 0 1-10 * *');

Related

how to get airflow schedule right

I found very confusing about how the airflow schedule works.
I would like to schedule a dag that runs on Friday and I would like use its result on Saturday. So I did the crontab expression like this: 00 16 * * 5, however, as of today 2020-03-10, the last execution date I got from airflow run is 2020-02-28. This is not desired as the most recent Friday is actually 2020-03-06, I couldn't get the 2020-03-06 to run unless I schedule it every day and skip it if it is not Friday. Is there a way to do this schedule right?
A lot of people get confused by how Airflow's execution_date and schedule_interval values work, namely that it waits for a period of time to "close" before it'll execute for that period; here's a portion from a previous answer I gave:
Think of it like this: If you ran a process quarterly and generated a report from data for that quarter, would you name the report for the quarter you were in when you created the file, or for the quarter the data in the report is from? That's what the execution_date is.
Try changing your start_date to be less one whole schedule interval. It should run on 03/06 but its execution_date will say 02/28

DBMS_SCHEDULING Repeat Interval - Half Hourly, 9-5, Mon-Fri

I'm trying to work out if I can put together a repeat interval to apply to a Schedule that runs every half an hour between 9-5 on Monday to Friday.
I have this so far but am struggling to limit the time to within 9-5
FREQ=DAILY; BYDAY=MON,TUE,WED,THU,FRI; BYHOUR=9,10,11,12,13,14,15,16,17;BYMINUTE= 30;
If I run this, it will execute correctly during the 9-5 period; however, it will also execute every 30 minutes past every hour before 9 and after 5. I need to to only begin running >= 09:00 and <=17:00
I'd say that you're close - replace
BYMINUTE= 30
with
BYMINUTE= 0,30

Running a Cron job daily 8 PM EST for Magento

Could you please help me to run my cron job daily 8 PM EST for Magento in following format
<schedule><cron_expr>* * * * *</cron_expr></schedule>
If this a simple cron expression you can refer to the cron documentation directly. One thing though I think you will be restricted to the local machine time zone of the machine where this task is running.
The explanation of the five stars is here:-
Field Allowed values
----- --------------
minute 0-59
hour 0-23
day of month 1-31
month 1-12 (or names, see below)
day of week 0-7 (0 or 7 is Sunday, or use names)
So daily 8 p.m. would be 0 20 * * *
Reference: http://man7.org/linux/man-pages/man5/crontab.5.html
I think you need to add EST part after schedule and before cron expression to get desired result.
0 20 * * * TZ="America/New_York" </cron_expr></schedule>

Jenkins - Build job monthly or weekly

What is the cron syntax for scheduling a Jenkins job:
a) monthly
b) weekly
Thanks!
Jenkins provides a helpful overview here. If you tick on Build periodically in the job configuration, you can click on the question mark next to Schedule.
I just want to quote one small part of it (it's always helpful to read the entire help yourself):
This field follows the syntax of cron (with minor differences).
Specifically, each line consists of 5 fields separated by TAB or
whitespace:
MINUTE HOUR DOM MONTH DOW
MINUTE Minutes within the hour (0–59)
HOUR The hour of the day (0–23)
DOM The day of the month (1–31)
MONTH The month (1–12)
DOW The day of the week (0–7) where 0 and 7 are Sunday.
[...]
In addition, #yearly, #annually, #monthly, #weekly, #daily, #midnight,
and #hourly are supported as convenient aliases. These use the hash
system for automatic balancing. For example, #hourly is the same as
H * * * * and could mean at any time during the hour. #midnight
actually means some time between 12:00 AM and 2:59 AM.
Jenkins also supports predefined aliases to schedule build:
#hourly, #daily, #weekly, #monthly, #midnight
#hourly --> Build every hour at the beginning of the hour --> 0 * * * *
#daily, #midnight --> Build every day at midnight --> 0 0 * * *
#weekly --> Build every week at midnight on Sunday morning --> 0 0 * * 0
#monthly --> Build every month at midnight of the first day of the month --> 0 0 1 * *
For weekly I successfully use: H 0 * * 0

Quartz cron expression - last thursday of every month

I am using Quartz Scheduling and Spring Batch and I need to run a particular job on the last Thursday of every month.
Is it possible to create such a Quartz cron expression?
Thanks,
Yes, Quartz has a special character -- L ("last") --, which allows you to define expressions such as the last friday of the month.
To fire a job at, say, 10am, on the last Thursday (5L) of every month, you can use the following cron expression:
0 0 10 ? * 5L

Resources