PyBlosxom |
/Admin/crontab:
Hiding / Redirection Cron Job Output
I seem to be regularly looking this up, so: cron jobs, by default, e-mail any output or errors to the user who owns the cron job.
Therefore a cron job that looks like this:
9 9 * * * /do/something/here
will e-mail all output. To hide normal output:
9 9 * * * /do/something/here > /dev/null
To hide normal output and any errors:
9 9 * * * /do/something/here > /dev/null 2>&1
To redirect normal output to a log file or a different e-mail address:
9 9 * * * /do/something/here > /path/to/logfile.log
9 9 * * * /do/something/here | mail -s "Subject" you@youremail.com
posted at: 04:04 | path: /Admin/crontab | permanent link to this entry