PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 05/03/2016 9:35 AM by  Greg Moeller
Help deciphering cron_expression for SN
 4 Replies
Sort:
You are not authorized to post a reply.
Author Messages
Greg Moeller
Private
Private
Veteran Member
(3873 points)
Veteran Member
Posts:1377


Send Message:

--
04/29/2016 2:47 PM
    Has anyone had any luck deciphering the cron_expression field in the QRTZ_CRON_TRIGGERS table?
    For example: I have 10 0 9 ? * 6 *
    I know that this notification is scheduled for 9:00 M-F
    I get the 2nd and 3rd fields, but what do the other fields mean?
    Robby
    Sr. Technology Consultant
    Avaap
    Veteran Member
    (209 points)
    Veteran Member
    Posts:87


    Send Message:

    --
    05/02/2016 11:26 AM
    Greg,
    I've done some testing to see if I could decipher some of this field,
    In our database (LBI 10.2.0.0.126; SQL2008R2)
    The first field represents 'seconds', the second field represents 'minutes', the third field depends upon whether the schedule is 'Daily' or 'Hourly'.
    For 'Daily', the third field is the hour that the schedule will run (24 hour clock).
    For 'Hourly', the third field is the hour range the schedule will run, example 6-18, will run every hour from 6 AM to 6 PM. Absence of an hour range indicates the schedule runs all day.
    (I haven't figured out how a 'Weekly' or a 'Monthly' schedule is represented.) (YET!):-)

    So, an example would be 0 52 14 .....this would be 2:52:00 PM
    -------------
    I haven't figured out the question mark yet (?).
    -------------
    But, the last section, numbers bracketed by asterisk (*) and separated by commas, represent the days of the week the schedule will run. Where Sunday=1, Monday=2, etc.

    -Robby
    Greg Moeller
    Private
    Private
    Veteran Member
    (3873 points)
    Veteran Member
    Posts:1377


    Send Message:

    --
    05/02/2016 11:37 AM
    Thanks for the help, Robby.. (and anyone else that is attempting)....
    Unix cron doesn't have seconds, so that was throwing me for a loop.
    In my example, though the 6 confuses me because I know that this schedule is set up for M-F.

    Any additional help is really appreciated!!
    The.Sam.Groves
    Programmer Analyst
    St Lukes Hospital
    Veteran Member
    (265 points)
    Veteran Member
    Posts:89


    Send Message:

    --
    05/03/2016 9:09 AM
    QRTZ_CRON_TRIGGERS implies they used the standard Quartz Job Scheduler library.

    I'd suggest skimming over http://www.quartz-scheduler.org/doc...on-06.html

    However that leads you back to the same spot, they aren't doing anything special with the format other than adding a second field.

    Are you sure that's the only entry that refers to that notification (i.e. there aren't multiple entries and this is just the one that kicks off Fri/Sat?)
    Greg Moeller
    Private
    Private
    Veteran Member
    (3873 points)
    Veteran Member
    Posts:1377


    Send Message:

    --
    05/03/2016 9:35 AM
    Thanks very much for that link! And no, I'm not sure that is the only entry that refers to that notification... I'll check on that as well.
    You are not authorized to post a reply.