GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
CHRONIC(1) moreutils CHRONIC(1)

chronic - runs a command quietly unless it fails

chronic [-ev] COMMAND...

chronic runs a command, and arranges for its standard out and standard error to only be displayed if the command fails (exits nonzero or crashes). If the command succeeds, any extraneous output will be hidden.

A common use for chronic is for running a cron job. Rather than trying to keep the command quiet, and having to deal with mails containing accidental output when it succeeds, and not verbose enough output when it fails, you can just run it verbosely always, and use chronic to hide the successful output.

        0    1 * * * chronic backup # instead of backup >/dev/null 2>&1
        */20 * * * * chronic -ve my_script # verbose for debugging

-v
Verbose output (distinguishes between STDOUT and STDERR, also reports RETVAL)
-e
Stderr triggering. Triggers output when stderr output length is non-zero. Without -e chronic needs non-zero return value to trigger output.

In this mode, chronic's return value will be 2 if the command's return value is 0 but the command printed to stderr.

Copyright 2010 by Joey Hess <id@joeyh.name>

Original concept and "chronic" name by Chuck Houpt. Code for verbose and stderr trigger by Tomas 'Harvie' Mudrunka 2016.

Licensed under the GNU GPL version 2 or higher.

2022-04-09 0.67

Search for    or go to Top of page |  Section 1 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.