chronic
Silences command output unless it fails
TLDR
Run command silently unless it fails
$ chronic [command]
Verbose mode with stderr/stdout distinction$ chronic -v [command]
Trigger on stderr output$ chronic -e [command]
Verbose with stderr triggering$ chronic -ve [command]
Use in a cron job instead of redirecting to /dev/null$ 0 1 * * * chronic backup
SYNOPSIS
chronic [options] command
DESCRIPTION
chronic runs a command quietly, showing output only if the command fails (non-zero exit or crash). Part of moreutils. Ideal for cron jobs where you want verbose commands but silent success.
PARAMETERS
-v
Verbose mode: distinguish stdout/stderr, report return value-e
Stderr triggering: show output if stderr is non-empty
EXIT STATUS
0
Command succeeded with no stderr (in -e mode)1
Command failed2
Command succeeded but produced stderr (in -e mode)
BEHAVIOR
- Success (exit 0): output discarded
- Failure (exit != 0): output displayed
- With -e: stderr output triggers display even on success
CAVEATS
Part of moreutils package. Better than redirecting to /dev/null because you still see errors.
