Linux command
chronic 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
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
Run a backup script, showing output only if it fails or produces stderr
chronic -ve /usr/local/bin/backup.sh
说明
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.
参数
- -v
- Verbose mode: distinguish stdout/stderr, report return value
- -e
- Stderr triggering: show output if stderr is non-empty
FAQ
What is the chronic command used for?
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.
How do I run a basic chronic example?
Run `chronic [command]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -v do in chronic?
Verbose mode: distinguish stdout/stderr, report return value