In this app, Brixxbox allow users to add automated jobs to their workspace. If a user want to perform a task at regular intervals then user can add its task in a job schedular provided by Brixxbox.
Job provides functionality to automate the tasks provided by user after specific time interval and on regular basis. User can create one job for each task. Brixxbox will provide book keeping of those jobs, for example logging of errors etc. A job contains following properties.
Each job should have a meaningful name. It will help user to identify the purpose of the job. For example, status update job etc.
It is one of the most important properties. It is used to schedule jobs, it specifies that the job will run on a given scheduled time. Its value is divided in to five parts(* * * * *). The first part represent minutes. The allowed values ranges from(0-59), The second one represent hours and its value ranges from(0-23). Third part is day of a month, its value ranges from (1-31) . The fourth part is month itself, its value ranges from(1-12). The last part represents day of the week(0-6). 0 is for sunday, 1 is for monday and so on. In order to learn more about CRON click here.
App job allows user tasks to be of three types: server side function click here, sql statement click here, and sql stored procedure click here.
It is the customized code for above job types. It can be stored in the Brixxbox and will be utlized here.
Each job should have a user id attached to it. This creates ownership of the app job.
Each job should have have a meaningful description. It is optional but it will help all the workspace users to know exactly what a job is doing.
Lets now look at one example job. Suppose we want to prepare status emails for managers. We want to generate these emails at 03:00 every day. For this purpose we need to set the CRON value to (00 3 * * *). It means that on 00 minute of 03:00 hour, on every day of each month and on each week day execute this job. We also want to make this server side function. In next step, we will choose custom code script, as we have already written this script, we can select it from drop down list. Now we need to assign a user id to this job. In the end, we need to give description for our newly created job. In the below snapshot, we can see all the options filled. Click save button to save this job.
A cron expression consists of five individual parts (That is the basic version. Some cron expressions support additional values).
Part
Allowed Values
Minutes
0-59
Hours
0-23
Day of month
1-31
Month
1-12
Day of week
0-6 (0 = Sun, 1 = Mon, ...)
In addition to the above values the following characters can be used.
Character
Meaning
*
Any value e.g. * as the value for Hour
will select all the possible values 0,1,2,..,23 "every hour".
,
value list separator e.g. 0,30 as the value for Minute
will select 0 and 30 "every half hour".
-
Range of values e.g. 1-5 as the value for Day of week
will select Monday thru Friday
/
step values e.g. */3 as the value for Month
will select Jan, Apr, Jul, Oct. Writing "1,4,7,10" would yield the same result.
15 1 * * *
every day at 1:15 am
0 8-17 1-5 * *
Monday thru Friday, once every hour between 8am and 5:59pm
0 5 1 */3 *
at 5am on the first day of every third month of the year (Jan, Apr, Jul, Oct)
0 0 1 1 *
start of the year
*/5 3-14 * * 6
every five minutes between 3am and 2:59pm only on a Saturday
Cron expressions are widely used. To get more detailed information those links might be helpful