How to set flux cron expression for seconds to schedule an event? - flux

I would like to schedule an event for every 15 seconds and must use flux library.
Using '0 0 +15' I'm able to set a schedule to run every 15 minutes,
However, when I tried for 15 sec my event is not picked up.
Any ideas on how I can resolve this?

Related

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

Is there any way to get delay of specific time using persistence database like redis?

I want to insert a delay of 30 minutes between two function call for eg:
sending email after 30 minutes once fcm/sms is sent.
I'm trying to use Redis for this so I'm using node module name bull which allows me to create a job with the delay and push it inside the queue.
//sending sms to user
sms(null, {to: phone,content: {msg: "test message"},sender: "XYZ"});
// here I have to add a delay of 30 minutes
// sending notification to user
fcm(null,{user_ids: userId,message: "restart!!!"});
I don't want to use setTimeout as it will not work if my app will restart.
I was able to do it using bull https://www.npmjs.com/package/bull this package contains the option to add delays in the milliseconds:-
For example, adding a delay of 30 mins
providerDelayedQueue.add(options, { delay: 1800000 });
The above job will be consumed at least after a delay of 30 mins.

Call cron.php once a day - Magento settings

Like a lot of users i've some problems configuring Magento cronjobs (my cartrules doesn't update properly on Magento 1.8.1. I also modified my cron.php adding $isShellDisabled = true;).
A tried a lot of things, but it doesn't work. Installed AOE scheduler, and i see all my tasks as pending!
My hosting let me to call cron.php once a day (3 am, and it's working, becase it generates the tasks at that time), so i'm wondering if is useless having settings like this:
Generate Schedules Every 15
Schedule Ahead for 1
Missed if Not Run Within 60
History Cleanup Every 120
Success History Lifetime 1400
Failure History Lifetime 1400
If i run manually the cron.php, it generates tasks for a hour, all pending (for example, my cart rules XML are set to update every 15 minutes, so i get 4 cartrules tasks)
If i run it again (after few minutes), all tasks between this time change form Pending to Success.
So, have i to call it at least twice a day? Or i have to change my cron settings?
thank you for the help
Use this cron expression for each hour:
<cron_expr>0 * * * *</cron_expr>
This will make it run at 12.00, 1.00 and so on.
If you want to make it run at 12.30, 1.30 and so on replace 0 with 30

quartz spring cron trigger fire immediately

I have a spring application that uses quartz cron trigger. I have given the following for frequency 0 0/20 * * * ?.....once every 20 min. But i want the first one to run immediately. Right now, when I start the application, it runs after 20 min. I was hoping it would run asap and then after 20 min.
Thanks in advance.
It sounds like you want to use an interval trigger (SimpleTrigger in Quartz can do the job).
The CronTrigger wants you to specify the minutes at which to run.
So your trigger schedule says: start at 0 minutes, and run every 20 minutes after that until the hour is over. Then start at 0 again.
But with the SimpleTrigger, you say - start now and run every 20 minutes.
Here is a tutorial on SimpleTrigger:
http://quartz-scheduler.org/documentation/quartz-2.x/tutorials/tutorial-lesson-05
Here is a tutorial on CronTrigger:
http://quartz-scheduler.org/documentation/quartz-1.x/tutorials/crontrigger
You don't need CRON expression (and Quartz at all!) to run given code every 20 minutes. Just use fixed rate (Spring built-in):
#Scheduled(fixedRate=20 * 60 * 1000)
That's it! By default first invocation happens immediately, second after 20 minutes. Since Spring 3.2 you can even say initialDelay=10000 to run for the first time after exactly 10 seconds.
If you really want to use Quartz, check out SimpleTrigger.

How to customize a Periodic Task on Windows Phone?

I need to use a customized Periodic Task in Windows Phone 8. I have read from the below link that it runs every 30 minutes.
http://msdn.microsoft.com/en-us/library/windowsphone/develop/hh202942(v=vs.105).aspx
So, I am looking for an option to customize this time. Say, I want to run the Periodic Task every 15 Seconds or 20 Seconds.
Is this possible?
That is not possible. Every 30min is the lowest interval.
If you dont release the code on the market you can do this....
DateTime lastrun;
IsolatedStorageSettings.ApplicationSettings.TryGetValue<DateTime>("lastrun", out lastrun);
if (DateTime.Now.Subtract(lastrun).TotalMinutes < 60) // 60 minutes, so run every hour
{
System.Diagnostics.Debug.WriteLine("Too soon, stopping.");
NotifyComplete();
return;
}
//add proper code for removing old value, etc.
IsolatedStorageSettings.ApplicationSettings.Add("lastrun", DateTime.Now);
// Launch the task in 6 minutes
ScheduledActionService.LaunchForTest("task", TimeSpan.FromMinutes(6));

Resources