Cron job set up in local timezone gets incorrectly converted to UTC (using Serverless Local Schedule) - aws-lambda

I have a schedule for job set up as follows using serverless-local-schedule:
- schedule:
rate: cron(1 0 20 * ? *)
timezone: Asia/Tokyo
It is supposed to run at 00:01 on the 20th day of each month. However, the schedule expression for the trigger that actually appears in AWS console looks like this:
cron(1 15 20 * ? *)
Time difference is calculated correctly (it's a 9-hour difference), but change of day is not taken into account - it should be:
cron(1 15 19 * ? *)
The job did run a day later than supposed to. What might be the cause of this issue?

Related

String #Scheduled trigged before the set time with long time pass

I made a schedule by #Scheduled
#Scheduled(cron = "0 0 23 * * ?")
but the method trigged 9 PM or 10 PM everyday, it not only 1 second different, it for a long time
log:
2023-01-14 21:04:12,582 INFO c.e.t.b.d.c.DAGController [scheduling-1]
and different trigged time every day
the server runs on k8s
the pod date is correct, the server date is correct
Spring version : 5.1.6.RELEASE
add some infomation
1, #Scheduled used with #Async. There are three schedule task on 8AM, 10PM and 11PM, each one is finished quickly started early from logs. The first task after server starting started on wrong time
2, server and k8s pod use CST time, and time is correct. There is no rule for running time , the running time is different every day, and it is not a full point
3,restart pod ,restart server , repull image from harbor is useless
need help, thanks

What is "INTERVAL=0" means in Oracle Schedular?

My Oracle DBA have setup a task with following repeat_interval:
Start Date :"30/JAN/20 08:00AM"
Repeat_interval: "FREQ=DAILY; INTERVAL=0; BYMINUTE=15"
Can I ask what is "Interval=0" means?
Does it means this task will run daily from 8AM, and will repeat every 15 mins until success?
I tried to get the answer from Google, but what I find is what is Interval=1, but nothing for 0.
So would be great if anyone can share me some light here.
Thanks in advance!
INTERVAL is the number of increments of the FREQ value between executions. I believe in this case that a value of 0 or 1 would be the same. The schedule as shown would execute once per day (FREQ=DAILY), at approximately 15 minutes past a random hour (BYMINUTE=15, but BYHOUR and BYSECOND are not set).
Schedule has nothing to do with whether or not the previous execution succeeded or not. Start Date is only the date at which the job was enabled, not when it actually starts processing.
If you want it to run every 15 minutes from the moment you enable it, you should set as follows:
FREQ=MINUTELY; INTERVAL=15
If you want it to run exactly on the quarter hour, then this:
FREQ=MINUTELY; BYMINUTE=0,15,30,45; BYSECOND=0
If you want it to run every day at 8am, then this:
FREQ=DAILY; BYHOUR=8; BYMINUTE=0; BYSECOND=0

How can we schedule nifi data flow ? I'm using HDP 2.5

I want to schedule data flow in daily base through nifi.
For Example,
I need to run schedule on 9.00 AM in every morning.
Can anyone tell me what is procedure to make schedule data flow
There are three scheduling strategy available, see below details
Timer driven: This is the default mode. The Processor will be scheduled to run on a regular interval. The interval at which the Processor is run is defined by the ‘Run schedule’ option (see below).
Event driven: When this mode is selected, the Processor will be triggered to run by an event, and that event occurs when FlowFiles enter Connections feeding this Processor. This mode is currently considered experimental and is not supported by all Processors. When this mode is selected, the ‘Run schedule’ option is not configurable, as the Processor is not triggered to run periodically but as the result of an event. Additionally, this is the only mode for which the ‘Concurrent tasks’ option can be set to 0. In this case, the number of threads is limited only by the size of the Event-Driven Thread Pool that the administrator has configured.
CRON driven: When using the CRON driven scheduling mode, the Processor is scheduled to run periodically, similar to the Timer driven scheduling mode. However, the CRON driven mode provides significantly more flexibility at the expense of increasing the complexity of the configuration. The CRON driven scheduling value is a string of six required fields and one optional field, each separated by a space.
You typically specify values one of the following ways:
Number: Specify one or more valid value. You can enter more than one value using a comma-separated list.
Range: Specify a range using the - syntax.
Increment: Specify an increment using / syntax. For example, in the Minutes field, 0/15 indicates the minutes 0, 15, 30, and 45.
You should also be aware of several valid special characters:
* — Indicates that all values are valid for that field.
?  — Indicates that no specific value is specified. This special character is valid in the Days of Month and Days of Week field.
L  — You can append L to one of the Day of Week values, to specify the last occurrence of this day in the month. For example, 1L indicates the last Sunday of the month.
For example:
The string 0 0 13 * * ? indicates that you want to schedule the processor to run at 1:00 PM every day.
The string 0 20 14 ? * MON-FRI indicates that you want to schedule the processor to run at 2:20 PM every Monday through Friday.
The string 0 15 10 ? * 6L 2011-2017 indicates that you want to schedule the processor to run at 10:15 AM, on the last Friday of every month, between 2011 and 2017.
For your schedule time should be like below;
0109*?** - this meaning every 1 seconds 09 minutes is morning 9 AM other * fields run every day and month.
I hope it helps you!!!
Scheduling Strategy: CRON driven
Run Schedule: 0 0 9 * * ? *

CRON: Run job on particular hours

I have a spring batch application and i am using CRON to set how often this application runs. But the problem i am running into is that i want to run the job on specific hours
3 am
7 am
11 am
3 pm
7 pm
11 pm
As you can see it is every 4 hours but starts at 3 am so i cannot use */4 in the hours section of the timing format as this would start the job at 4am
I have also tried '3,7,11,15,19,23' in the hours section but this does not work either (guessing it only works in the minutes section). Does someone know how i can do this?
Use
#Scedule(cron="0 0 3/4 * * ?")
The Pattern x/y means: where <timepart> mod y = x
or
#Scedule(cron="0 0 3,7,11,15,19,21 * * ?")
According to the Quartz Cron Trigger Tutorial:
The '/' character can be used to specify increments to values. For
example, if you put '0/15' in the Minutes field, it means 'every 15th
minute of the hour, starting at minute zero'. If you used '3/20' in
the Minutes field, it would mean 'every 20th minute of the hour,
starting at minute three' - or in other words it is the same as
specifying '3,23,43' in the Minutes field. Note the subtlety that
"/35" does *not mean "every 35 minutes" - it mean "every 35th minute
of the hour, starting at minute zero" - or in other words the same as
specifying '0,35'.
0 0 3,7,11,15,19,23 * * ?
Fires for 0 minute starting at 3am and ending at 23:00 pm every day.
judging by the two answers above the error i was making was i was keeping the apostrophe at the start and end of my hours... very silly
i managed to solve this by using 3-23/4 for the hour as this starts from 3am and then every other fourth hour (just a different way of doing it to the other answers)

Time based build scheduling in Teamcity

In Teamcity (version 7.1) how do I set up a build to be triggered to run every 20 mins for example?
I notice you can set up timed based schedules, for example "Run this build at 18:00 everyday" but that's not quite what I want.
You can use a Schedule trigger with cron expressions to do this.
I believe you'd need this one:
Seconds: 0
Minutes: 0,20,40
Hours: *
Day of month: *
Month: *
Day of week: ?
Year: *
(or whatever interval you desire)
TeamCity uses Quartz for scheduling, see more cron expression examples.
The cron expression you need is "0 0/20 * * * ? *"
See these cron expression examples
The the cron expression here:
Under the Build Configuration Settings
Triggers > "Add new trigger" > "Schedule Trigger"
Select "advanced (cron expression) from the "When:" dropdown
This is for TeamCity version: 2017.1.2
run every half hour
Hours set "*" - run every hour
Minutes set "0,30" - run every 0 minute and 30 minute
You can trigger builds using HTTP and so you could do what you are asking for by making such requests using your operating systems task scheduler.
http://confluence.jetbrains.com/display/TCD7/Accessing+Server+by+HTTP

Resources