How to handle day light saving in oozie coordinator? - hive

Due to day light saving all my scheduled jobs(using oozie) are running later one hour.
Before DST : My jobs runs every day at 8:00 pm
after DST: Now job is running at 9:00 pm
could any tell is there way to handle day light saving in oozie cooridnator ?

Did you find a tip?
I have scheduled coordinators who have to run every day at a fixed time, regardless of summer or winter time, with a cron expression.
< coordinator-app xmlns = "uri:oozie:coordinator:0.5" end="2024-12-04T23:59Z" frequency="6 10 * * MON,TUE,WED,THU,FRI,SAT,SUN" name="COORD_SAMPLE"start="2019-12-04T00:01Z" timezone="Europe / Paris ">
But in the transition to summer time, there will be a shift of 1 hour as I had the transition from summer to winter time.

Related

Why does the code below return 4:14 PM instead of 3:14 PM?

I'm trying to convert a UTC to a CST by using the 'ConvertTimeFromUtc' method. However, the result is off by 1 hour compared to what I got when I try to convert it manually online.
StatusDatetime is 2017-06-05 21:14:39.6216795
TimeZoneInfo.ConvertTimeFromUtc(StatusDatetime.Value,
TimeZoneInfo.FindSystemTimeZoneById("Central Standard Time")).ToString("hh:mm
tt")
Try using Central Daylight Time instead of Central Standard Time, as we are in daylight savings time.

Configuring Domino Program Document

I want to define a server task using Domino administrator(8.5.2). So using the menu
Server>>Programs>> and then using "Add Programs" I am trying to define a server task which should run at 12:00 and should repeat after 60 minutes 24 X 7.
But when I try to save the document I get a field validation error in the dialog-box which says:
"You cannot set an interval greater than 0 for single times. The entries you put in the 'Run at times' field includes at least one single time element."
Not sure that I understood the validation error. As per my understanding I have set 'Run at times' field as 12:00 each day. And the 'Repeat interval of' is 60 minutes. What do these fields mean ?. For example in my case I want this server task to run after 60 minutes each and 24 X 7. Please let me know.
Thanks in advance.
Enter 00:00 - 23:59 as period and 60 minutes as interval. Or enter 12:00; 13:00; 14:00; ... ; 11:00 as times and 0 minutes as interval.
Then you can save the document and it does what you want.

apscheduler at 90 second intervals?

Is it possible to set an apscheduler cron job to run at 90 second intervals? (I have 40 machines that I'd like to schedule evenly over an hour without hard coding time info into the script). I've tried various kinds of this:
job = sched.add_cron_job(_test, minute='*/1', second='30')
job = sched.add_cron_job(_test, minute='*', second='90')
Try this instead:
job = sched.add_interval_job(_test, seconds=90)
Based on your question you want to start a cron job at a particular time and run it indefinitely with 90 seconds interval. You can achieve this by combining triggers
from apscheduler.schedulers.background import BackgroundScheduler
from apscheduler.triggers.combining import AndTrigger
from apscheduler.triggers.interval import IntervalTrigger
from apscheduler.triggers.cron import CronTrigger
def _test():
print("code comes here")
scheduler = BackgroundScheduler()
# Runs on 2019-12-30 at 5:30 (am) & repeats every 90 seconds interval
trigger = AndTrigger([IntervalTrigger(seconds=90),
CronTrigger(start_date='2019-12-30', hour=5, minute=30)])
scheduler.add_job(_test, trigger)
scheduler.start()
Interval code example:
sched = BlockingScheduler()
sched.add_job(ClassTest, 'interval', seconds=90)
sched.start()

When does the first occurrence of a recurring timed BackgroundTask run?

If you register a BackgroundTask with a recurring TimeTrigger (OneShot set to false), when does the first occurrence run? After the first FreshnessTime minutes or before?
Microsoft documentation states:
If FreshnessTime is set to 15 minutes and OneShot is false, the task
will run every 15 minutes starting between 0 and 15 minutes from the
time it is registered.
edit
I tested this a few times and it seems to run the first occurrence at anytime during the 15 minute period after registration. It then runs future occurrences at regular 15 minute periods based on 15 minutes from the start time of the previous run.
I'm not sure internally how the OS is scheduling the timer cycles but the answer to your question is not after, not before but during.
nb. You cannot get any timer background task to fire immediately.

keeping DateTime.Now.timeofday.tostring() updated while app is running

Here's my Problem when I start the app. for example at 3:00 PM and I use the DateTime.Now.timeofday.tostring() and output it, it calls out 3:00 PM, but after waiting 5 mins (3:05) without closing the app, I still get the same output (3:00). how do I make sure that the time is always up to date without having to close the app.???
To get current time you may use either
DateTime.Now.ToLongTimeString()
or
DateTime.Now.ToShortTimeString()
It will get updated properly.