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

PropertyValue
Command typeDriver query
Required permissionAdministrator
License usageCounted
Parallel executionNot supported
Distributed executionRuns on Data Node (mapper)

Syntax

linux-cron-jobs

Output fields

FieldTypeDescription
userstringOwner of the crontab file. Extracted from the crontab file name.
cron_schedulestringCron schedule expression. Consists of 5 fields: minute, hour, day, month, and day of the week.
cmd_linestringCommand to run according to the schedule

Error codes

Parsing errors
Error codeMessageDescription
95040no-read-permissionA user without administrator privileges executed the command
Runtime errors
Error codeMessageDescriptionAction on error
--An I/O error occurred while reading a crontab fileAborts 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

  1. Query all crontab scheduled jobs

    linux-cron-jobs
    

    Queries crontab scheduled jobs for all users registered on the system.

  2. 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.