This tutorial demonstrates how to create a new CRON job and details the available parameters.
-
Open the configuration for your device in LANconfig.
-
Navigate to the Cron table in the
dialog and click
Add to create a new CRON job.
-
Specify a time basis.
The time basis determines whether LCOS executes the scheduled action
based on the real-time clock or the device's runtime. In the Real time setting, the system evaluates all time and date inputs. In the Operation
time setting, the system only evaluates the
minute and hour values since the last device restart.
-
Enter a delay under Variation in
minutes to set the maximum delay of a CRON job execution relative to the defined start time.
The actual delay is determined randomly by the device, between zero and the entered time. If the variation is set to
zero, the CRON job is executed exactly at the specified time.
Note: Real-time-based rules can only be executed if your device has a
valid time reference, such as via NTP.
-
Specify the minute(s), hour(s), day(s) of the week, day(s) of the month, and month(s) when your device should execute the
specified command.
If no value is entered, the device will not consider that time parameter in its scheduling. For each parameter, you can
optionally enter a comma-separated list of values or a range (formatted as <day>-<day>, e.g., 1-5). A
step value can be defined using /. If a range precedes the step value, it applies to the defined range.
The syntax of the Weekdays field corresponds to the standard CRON interpretation:
Sunday |
Monday |
Tuesday |
Wednesday |
Thursday |
Friday |
Saturday |
0 |
1 |
2 |
3 |
4 |
5 |
6 |
Note: The weekday field is also relevant for operation-time-based rules. This is useful for actions you want to
execute only once at device start (i.e., at zero days of runtime). For example, this allows you to align the weekday against the
days of operation time.
-
Enter the command(s) to execute under Commands.
Any command-line function can be executed.
-
Specify the Owner of the CRON job.
An administrator defined on the device can be selected as the owner. If an owner is specified, the CRON job commands
are executed with the owner's permissions.
-
Enter a brief description of the CRON job in the Comment field.
-
Click OK to save the entry. Then write the configuration back to the device.
Additional configuration examples:
Time Basis |
Min. |
Hr. |
Wk. Days |
Mo. Days |
Months |
Command |
Real time |
0 |
4 |
0-6 |
1-31 |
1-12 |
do /so/man/disconnect internet |
Real time |
59 |
3 |
0-6 |
1-31 |
1-12 |
mailto:admin@example.com?subject=Forced-disconnect?body=Manual Internet discconnect |
Real time |
0 |
0 |
|
1 |
|
do /setup/accounting/delete |
Real time |
0 |
18 |
1,2,3,4,5 |
|
|
do /so/man/connect MAINOFFICE |
Real time |
/10 |
|
|
|
|
do command |
- The first entry disconnects from the internet provider every morning at 4:00 AM (forced disconnection).
- The second entry sends an info email to the admin every morning at 3:59 AM, just before the forced disconnection.
- The third entry deletes the accounting table on the first day of every month.
- The fourth entry establishes a connection to headquarters at 6:00 PM on weekdays.
- The fifth entry executes a command every 10 minutes.
Important: The device executes scheduled rules with a precision of one minute. Ensure that the language of the entered
commands matches the console language, as the device will otherwise ignore the automation commands.