Cron scripts can be used to automate processes, providing you with a useful tool for executing recurring tasks automatically.
Once a cron job has been set up once for the domain via an external service, any scripts or tasks can be set up, administered and monitored via the interface.
Examples of useful scripts include
In addition to the shortest execution interval, you can also set exactly when the script should be executed in the respective cron script. For example, a script can be executed every hour, every Saturday night or only on December 1, 2019 at 6:00 a.m. (see also further examples below).
The cron scripts screen lists the cron scripts that have already been created with their titles.
The interval at which each cron script can be executed is displayed in the list. The following buttons are located next to it:
Click on the "Create new cron script" button to create a new cron script.
The following setting options are available on the screen when editing a cron script:
In this field, enter the title for the cron script, which is used for display in the list of cron scripts.
Use this selection field to specify whether the cron script is active or inactive. Accordingly, a green status symbol for active and a red status symbol for inactive (deactivated) is displayed in the list of cron scripts.
In this field, enter the shortest possible execution interval for the cron script (specified in seconds, e.g. 60 for 60 seconds).
The fields for specifying the interval are described below.
A limit is possible per field using the following syntax: 1 or 1-3 or 1,2,3.
The cron job is then only executed if the current time corresponds to the respective values.
In this field, you can optionally enter the minutes at which the cron script can be executed when called. No entry corresponds to the setting for every minute.
Example:
In this field, you can optionally enter the hours at which the cron script can be executed when called. No entry corresponds to the setting for every hour.
Example:
In this field, you can optionally enter the days of the week on which the cron script can be executed when called. No entry corresponds to the setting for all days of the week.
Example:
In this field, you can optionally enter the days of the month on which the cron script can be executed when called. No entry corresponds to the setting for all days of the month.
Example:
In this field, you can optionally enter the months in which the cron script can be executed when called. No entry corresponds to the setting for all months.
Example:
In this field, you can optionally enter the year in which the cron script can be executed when called. No entry corresponds to the setting for all future years.
Example:
Enter the script code for the cron script in this field. Alternatively, you can also insert this by clicking on the macros on the right-hand side.
In addition to the complete PHP framework, ready-made, frequently used scripts are also available within the cron scripts. You will find these macros in the mask of the cron script on the right-hand side. By clicking on such a macro, the script code is inserted in the"Cron job source code" window and can be customized as required.
If a cron script is addressed directly (e.g. via the "Run now" start icon), the script is always executed directly. This allows the functionality of a single cron script to be checked.
The intervals are only taken into account when called via the central cron script(/weblication/grid5/scripts/wCron.php), which is usually called via a cron job set up with the provider.
If you call this via the licensed domain (e.g. https://www. IhreDomain.tld/weblication/grid5/scripts/wCron.php), the system displays for each cron script whether it has been executed and when it can be executed again at the earliest.
It is recommended to set the cronjob at the provider with an interval that does not exceed the smallest interval of a cron script (e.g. smallest interval cron script of 6 minutes -> cronjob at the provider every 5 minutes).
Set intervals:
Shortest possible execution interval in seconds: 60
Minutes:
Hours:
Days of the week:
Days of the month:
Months:
Year:
The script is executed every minute starting with the first call via wCron.php.
Set intervals:
Shortest possible execution interval in seconds: 3600
Minutes:
Hours:
Days of the week:
Days of the month:
Months:
Year:
The script is executed every hour starting with the first call via wCron.php.
Set intervals:
Shortest possible execution interval in seconds: 60
Minutes:
Hours: 0
Days of the week:
Days of the month:
Months:
Year:
The script is executed every day at 00:00 when called via wCron.php.
Set intervals:
Shortest possible execution interval in seconds: 60
Minutes:
Hours: 2.3
Days of the week:
Days of the month:
Months:
Year:
The script is executed every day from 01:00 to 02:59 when called via wCron.php.
Set intervals:
Shortest possible execution interval in seconds: 60
Minutes: 0
Hours: 23
Days of the week: 6
Days of the month:
Months:
Year:
The script is executed every Saturday night at 23:00 when called via wCron.php.
Set intervals:
Shortest possible execution interval in seconds: 60
Minutes: 0
Hours: 6
Days of the week:
Days of the month: 1
Months: 12
Year: 2019
The script is executed once at 06:00 on December 1, 2019 when called via wCron.php.
Set intervals:
Shortest possible execution interval in seconds: 60
Minutes:
Hours: 1
Weekdays:3.5
Days of the month:
Months:
Year:
The script is always executed on Wednesday and Friday night, 01:00 to 01:59 (as no minutes are limited). During this time, the wCron.php executes the script when it is called.