1CHRONIC(1)                                                          CHRONIC(1)
2
3
4

NAME

6       chronic - runs a command quietly unless it fails
7

SYNOPSIS

9       chronic [-ev] COMMAND...
10

DESCRIPTION

12       chronic runs a command, and arranges for its standard out and standard
13       error to only be displayed if the command fails (exits nonzero or
14       crashes).  If the command succeeds, any extraneous output will be
15       hidden.
16
17       A common use for chronic is for running a cron job. Rather than trying
18       to keep the command quiet, and having to deal with mails containing
19       accidental output when it succeeds, and not verbose enough output when
20       it fails, you can just run it verbosely always, and use chronic to hide
21       the successful output.
22
23               0    1 * * * chronic backup # instead of backup >/dev/null 2>&1
24               */20 * * * * chronic -ve my_script # verbose for debugging
25

OPTIONS

27       -v  Verbose output (distinguishes between STDOUT and STDERR, also
28           reports RETVAL)
29
30       -e  Stderr triggering. Triggers output when stderr output length is
31           non-zero.  Without -e chronic needs non-zero return value to
32           trigger output.
33
34           In this mode, chronic's return value will be 2 if the command's
35           return value is 0 but the command printed to stderr.
36

AUTHOR

38       Copyright 2010 by Joey Hess <id@joeyh.name>
39
40       Original concept and "chronic" name by Chuck Houpt.  Code for verbose
41       and stderr trigger by Tomas 'Harvie' Mudrunka 2016.
42
43       Licensed under the GNU GPL version 2 or higher.
44
45
46
47moreutils                         2021-07-22                        CHRONIC(1)
Impressum