Linux command
cronic 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
Run a command
cronic [command] [args...]
Run a cron job silently
cronic /path/to/script.sh
说明
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.
FAQ
What is the cronic command used for?
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.
How do I run a basic cronic example?
Run `cronic [command] [args...]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
Where can I find more cronic examples?
This page includes 2 examples for cronic, plus related commands for nearby Linux tasks.