linux-cron-jobs
Queries crontab scheduled job configurations registered on a Linux system. Reads per-user crontab files from the /var/spool/cron/crontabs/, /var/spool/cron/, and /var/cron/tabs/ directories and returns the schedule and command as structured fields.
Command properties
| Property | Value |
|---|---|
| Command type | Driver query |
| Required permission | Administrator |
| License usage | Counted |
| Parallel execution | Not supported |
| Distributed execution | Runs on Data Node (mapper) |
Syntax
Output fields
| Field | Type | Description |
|---|---|---|
user | string | Owner of the crontab file. Extracted from the crontab file name. |
cron_schedule | string | Cron schedule expression. Consists of 5 fields: minute, hour, day, month, and day of the week. |
cmd_line | string | Command to run according to the schedule |
Error codes
Parsing errors
| Error code | Message | Description |
|---|---|---|
| 95040 | no-read-permission | A user without administrator privileges executed the command |
Runtime errors
| Error code | Message | Description | Action on error |
|---|---|---|---|
| - | - | An I/O error occurred while reading a crontab file | Aborts query execution |
Description
The linux-cron-jobs command collects per-user scheduled job configurations from crontab directories on the Linux system. It searches the following directories in order:
/var/spool/cron/crontabs/(Debian-based)/var/spool/cron/(Red Hat-based)/var/cron/tabs/(other distributions)
In each directory, it finds readable crontab files, then parses valid cron entries, excluding comments and blank lines. The cron expression (minute, hour, day, month, day of the week) and the command are separated and assigned to output fields.
Examples
-
Query all crontab scheduled jobs
linux-cron-jobsQueries crontab scheduled jobs for all users registered on the system.
-
Query scheduled jobs for a specific user
linux-cron-jobs | search user == "root"Filters and queries only the crontab scheduled jobs of the root user.