LinuxCommandLibrary

cronic

cron job output suppressor

TLDR

Run a command and only show output on error

$ cronic [command] [args...]
copy
Run a cron job silently unless it fails
$ cronic /path/to/script.sh
copy

SYNOPSIS

cronic command [args...]

DESCRIPTION

cronic is a shell script wrapper for cron jobs that suppresses output unless the command fails. Without cronic, every cron job that produces output triggers an email to the user, leading to inbox clutter from routine successful executions.
cronic captures both stdout and stderr along with the exit code. If the command succeeds (returns zero), all output is discarded. If the command fails (returns non-zero), cronic displays the captured output, allowing cron to send the failure notification email. This approach reduces email noise from successful jobs while ensuring administrators are alerted to actual failures.

CAVEATS

Part of the moreutils package. Output is buffered, which may be problematic for very long-running commands with large output.

SEE ALSO

chronic(1), cron(8)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community