cronic(1)

πŸ’– cronic β€” the manual page, but make it cute πŸ’–

okay bestie, welcome to cronic(1) β€” yes that's the section 1 manual page for cronic, and yes I'm about to make cron emails make sense to you. buckle up. πŸŽ€


✨ NAME ✨

cronic β€” a shell script that fixes the most annoying feature of cron: unwanted emailed output. πŸ¦‹


✨ SYNOPSIS ✨

cronic [COMMAND]

✨ DESCRIPTION ✨

so basically Cronic is a tiny sh shim shell script you wrap around your cron jobs, and the whole point is that cron only emails you when an error has occurred. that's it. that's the girl. πŸ’…

Cronic defines an error as any non-trace error output or a non-zero result code. either one shows up? you get an email. πŸ‘‘

Cronic filters Bash execution traces (or literally anything matching PS4) out of the error output, so you can run your jobs with execution tracing on and it won't spam you β€” the traces are still there to help with forensic debugging when you actually need them. no cap. πŸ”

Cronic has no options, it simply executes its arguments. that's the whole vibe.

0 1 * * * cronic backup

With cronic, you can turn on Bash's strict error handling and debug options β€” exit on error, unset variable detection and execution tracing β€” to make sure problems get caught early. the way that catches bugs before breakfast? iconic. πŸ“


✨ EXAMPLES ✨

Example cron job, look at her go:

#!/bin/bash
set -o errexit -o nounset -o xtrace
cp -rp data1 /backup
cp -rp data2 /backup
cp -rp data3 /backup

When an error is detected, Cronic outputs a report listing the result code, the error output, and the combined trace and error output. that combined output is the bestie move here β€” it helps put error messages in context. ✨

Example email from cron with cronic info:

From: user@example.net (Cron Daemon)
To: user@example.net
Subject: Cron <user@server> cronic backup

Cronic detected failure or error output for the command:
backup

RESULT CODE: 1

ERROR OUTPUT:
cp: data2: Permission denied

STANDARD OUTPUT:

TRACE-ERROR OUTPUT:
+ cp -rp data1 /backup
+ cp -rp data2 /backup
cp: data2: Permission denied

✨ VERSION HISTORY ✨

  • v3 β€” Use mktemp -d to avoid race-conditions and security problems. πŸ›‘οΈ
  • v2 β€” Corrected command evaluation, so shell meta-chars are preserved correctly (Thanks to Frank Wallingford for the fix). πŸ™
  • v1 β€” Initial release. the origin story. 🌱

✨ OTHER TOOLS ✨

Joey Hess has written a simpler perl version of cronic, named chronic. It is available in Debian as part of moreutils. different girl, same energy. πŸ’œ


✨ AUTHOR ✨

Cronic was written by Chuck Houpt. This man page was formatted from the cronic home page by Daniel Lange.


✨ REPORTING BUGS ✨

πŸ› please report bugs upstream to Chuck Houpt <chuck@habilis.net> and use the Debian bugtracker for Debian-specific issues. iykyk.

The cronic home page is <https://habilis.net/cronic/>.


Copyright © 2007-2016 Chuck Houpt. Debian packaging © 2016, 2018 Daniel Lange. License CCO: Public Domain dedication v1.0 <https://creativecommons.org/publicdomain/zero/1.0/>. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. 😭 (fr fr, read that one again)


✨ SEE ALSO ✨


and that's the whole page bestie 🫢 β€” this one's filed under admin, stamped May 2018 - v3, and it's the cronic(1) page straight from the cronic source. go forth and have a quiet inbox. πŸ‘‘πŸ’–

πŸ“¦ where this page comes from