Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

All of the data integration processes that are created through the use of the integration templates can be executed on a standard schedule through a CRON (Common Run On) job.

What is CRON?

The cron command-line utility, also known as CRON job, is a job scheduler process for all Unix-like operating systems. Through the Pricefx Integration Templates, users can set up and maintain a scheduling process using cron to schedule our integration inbound and outbound jobs to run periodically at fixed times, dates, or intervals.

CRON and Integration Template Scheduling

When we are configuring the use of our Integration Templates, within the Integration Properties supporting the route we are building, there will be an option to configure the CRON schedule:

...

You will notice that it is a text entry that is used to configure the parameters for the cron job execution and the layout can be interpreted as follows:

...

Info

NOTE: each line in the configuration can contain up to six different fields, but we can use combinations of these to define when and how often it will run.

CRON Parameters

These five fields (time and date) also accept the following operators:

  • * The asterisk operator (which is default with IM routes) means all allowed values. If you have the asterisk symbol in the Minute field, it means the task will be performed each minute.

  • - The hyphen operator will allow us to specify a range of designated values. If you set 1-5 in the Day of the week field, the task will run every weekday (From Monday to Friday). The range is deemed to be inclusive, which means that the first and last values are included in the range.

  • , The comma will allow us to define a list of values for repetition. For example, if you have 1,3,5 in the Hour field, the task will run at 1 am, 3 am and 5 am. The list can contain single values and ranges, 1-5,7,8,10-15

  • / The slash operator will allow us to specify step values that can be used in conjunction with ranges. For example, if you have 1-10/2 in the Minutes field, it means the action will be performed every two minutes in range 1-10 minutes. This could be considered the same as specifying 1,3,5,7,9.

Info

NOTE: Instead of a range of values, you can also use the asterisk operator. To specify a job to be run every 20 minutes, you can use “*/20”.

Run CRON Job Every 5 Minutes

There are two ways to run a cron job every five minutes. First option is to use the comma operator a create a list of minutes:

Code Block
0,5,10,15,20,25,30,35,40,45,50,55  * * * * command

Copy

Info

NOTE: The line above is syntactically correct and it will work just fine. However, typing the whole list can be tedious and prone to errors.

The second option to specify a job to be run every 5 minutes hours is to use the step operator:

Code Block
languagec
*/5  * * * * command

Copy

Info

NOTE: the “*/5” means create a list of all minutes and run the job for every fifth value from the list.