Cron Format Reference
NetXMS uses cron expressions to define recurring schedules for tasks such as scheduled scripts, maintenance windows, active network discovery, report generation, and file delivery jobs.
Expression Format
A cron expression consists of five or six space-separated fields:
minute hour day-of-month month day-of-week [seconds]
The seconds field (6th position) is optional. It is honored only by DCI custom collection schedules (both server-side and agent-side), which evaluate schedules every second. All other consumers — scheduled tasks, active network discovery, and log parser exclusion schedules — match schedules with minute resolution and ignore the seconds field, so a 6-field expression there behaves exactly like the same expression without its 6th field.
Field Definitions
| Field | Allowed Values | Special Characters | Notes |
|---|---|---|---|
Minute |
0-59 |
|
|
Hour |
0-23 |
|
Uses 24-hour format. |
Day of month |
1-31 |
|
Not all months have 31 days. Invalid dates are silently skipped. |
Month |
1-12 |
|
1 = January, 12 = December. |
Day of week |
0-7 |
|
0 and 7 both represent Sunday. 1 = Monday, 6 = Saturday. |
Seconds (optional) |
0-59 |
|
6th field. Honored only by DCI custom collection schedules; ignored by all other schedule consumers. |
Special Characters
| Character | Description |
|---|---|
|
Matches any value in the field. For example, |
|
Separates items in a list. For example, |
|
Defines an inclusive range. For example, |
|
Specifies a step value after |
|
"Last." On its own, |
|
Specifies the Nth occurrence of a weekday in the month. Used only in the day-of-week field. For example, |
|
Step against absolute time. Used only in the seconds field, in place of |
Day-of-Week Values
| Value | Day |
|---|---|
0 |
Sunday |
1 |
Monday |
2 |
Tuesday |
3 |
Wednesday |
4 |
Thursday |
5 |
Friday |
6 |
Saturday |
7 |
Sunday (alias for 0) |
Examples
| Expression | Description |
|---|---|
|
Every hour at minute 0. |
|
Every 15 minutes. |
|
Every weekday (Monday through Friday) at 08:00. |
|
First day of every month at midnight. |
|
Every Sunday at 02:30. |
|
Last day of every month at midnight. |
|
First Monday of every month at 09:00. |
|
Last Friday of every month at 22:00. |
|
Every 2 hours at minute 0 (00:00, 02:00, 04:00, …). |
|
Every hour from 08:00 to 17:00 on weekdays (business hours). |
6-Field Examples (with seconds)
These examples use the optional seconds field (6th position). The seconds field takes effect only in DCI custom collection schedules; in other contexts it is ignored.
| Expression | Description |
|---|---|
|
Every hour at minute 0, second 0. |
|
Every minute at second 30. |
|
Every Sunday at 02:00:00. |
|
Every 10 seconds. |
|
Every 30 minutes during business hours on weekdays, at the top of each half hour. |
| When the system detects 6 fields, the last field is interpreted as seconds. A 5-field expression always starts with the minute field. |
Where Cron Expressions Are Used
Cron expressions appear in the following NetXMS contexts:
-
Scheduled tasks — script execution, maintenance windows, notifications
-
Active network discovery — scan schedules
-
Data collection — custom collection schedules on DCIs
-
File delivery jobs — recurring file uploads
-
Report generation — report schedules
-
Log parser exclusion schedules — periods when log parsing is suspended
-
Server configuration variables that accept schedule values (e.g.,
NetworkDiscovery.ActiveDiscovery.Schedule)