When creating cron tasks on Linux many people do not realize that the output from the cron will logged and without redirection will sent to the user running the cron task’s email. In many cases this is the root user or if an alias has been set in /etc/aliases then the email will be sent to the user configured to receive roots email in the aliases file. Specifically on Backtrack Linux the root users email is redirected to bt5 by default and that user does not exist so the email will simply bounce. Below we describe a better way to redirect the cron tasks output into a log file which could be useful down the road.
Here are the ones I tried. Hope the comments aren’t too confusing
- Simple Rails Log Query Analyzer
ruby bin/query_log_analyzer.rb ../log/production.log
production.log.1 (small log file ~25MB)Just printed the “Totals” heading with no results
production.log (large log file ~400MB)Ran for a long time and nothing happened