CHRONIC(1)

✨ NAME ✨ β€” this is CHRONIC(1) from moreutils, bestie πŸ’…

chronic β€” runs a command quietly unless it fails. periodt πŸ’–βœ¨


🌸 SYNOPSIS 🌸

chronic [-ev] COMMAND...

πŸ’… DESCRIPTION πŸ’…

chronic runs a command, and arranges for its standard out and standard error to only be displayed if the command fails β€” that means it exits nonzero or crashes πŸ˜­πŸ’€. If the command succeeds, any extraneous output will be hidden πŸ™ˆβœ¨.

A common use for chronic is running a cron job πŸ•’. Instead of trying to keep the command quiet and dealing 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. iykyk, it’s giving automation main character energy πŸ’….

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

πŸŽ€ OPTIONS πŸŽ€

  • -v β€” Verbose output πŸ’¬: distinguishes between STDOUT and STDERR, and also reports RETVAL. slay.
  • -e β€” Stderr triggering πŸ’€: triggers output when stderr output length is non-zero. Without -e, chronic needs a 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 πŸ‘€.

πŸ‘‘ AUTHOR πŸ‘‘

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. 🌈

okay that’s the whole page, bestie β€” it’s from moreutils, dated 2025-06-30, and it’s the CHRONIC(1) manual page. slay and goodbye πŸ’–πŸ«Άβœ¨

πŸ“¦ where this page comes from