.\" man file for cronic .TH cronic "1" "May 2018 - v3" "admin" "admin" .SH NAME cronic \- a shell script to help control the most annoying feature of cron: unwanted emailed output .SH SYNOPSIS .B cronic [\fICOMMAND\fR] .SH DESCRIPTION .\" Add any additional description here .PP Cronic is a small shim shell script for wrapping cron jobs so that cron only sends email when an error has occurred. .PP Cronic defines an error as any non-trace error output or a non-zero result code. .PP Cronic filters Bash execution traces (or anything matching \fBPS4\fR) from the error output, so jobs can be run with execution tracing to aid forensic debugging. .PP Cronic has no options, it simply executes its arguments. .PP \fI0 1 * * * \fR\fBcronic\fR \fibackup\fR .PP 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 are caught early. .PP .SH EXAMPLES .B Example cron job: .PP .nf .RS #!/bin/bash set \-o errexit \-o nounset \-o xtrace cp \-rp data1 /backup cp \-rp data2 /backup cp \-rp data3 /backup .RE .fi .PP When an error is detected, Cronic outputs a report listing the result code, error output, and combined trace and error output. The combined output can help put error messages in context. .PP .B Example email from cron with cronic info: .PP .nf .RS From: user@example.net (Cron Daemon) To: user@example.net Subject: Cron 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 .RE .fi .PP .SH VERSION HISTORY \fBv3\fR \- Use mktemp \-d to avoid race-conditions and security problems. .PP \fBv2\fR \- Corrected command evaluation, so shell meta-chars are preserved correctly (Thanks to Frank Wallingford for the fix). .PP \fBv1\fR \- Initial release. .SH OTHER TOOLS Joey Hess has written a simpler perl version of cronic, named chronic. It is available in Debian as part of \fImoreutils\fR. .SH AUTHOR Cronic was written by Chuck Houpt. .br This man page was formatted from the cronic home page by Daniel Lange. .SH "REPORTING BUGS" Please report bugs upstream to Chuck Houpt and use the Debian bugtracker for Debian-specific issues. .br The cronic home page is . .SH COPYRIGHT Copyright \(co 2007-2016 Chuck Houpt. Debian packaging \(co 2016, 2018 Daniel Lange. .br License CCO: Public Domain dedication v1.0 . .br This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. .SH "SEE ALSO" .BR crontab(5), .BR bash(1) .\" end of man file for cronic. Daniel Lange 180506, man v1.2 for cronic v3