Please edit this cron to not send mail to root@?


#1

I have a cron as user www-data to import from webserver logs like so:

===

  • 2 * * * /var/www/piwik/misc/log-analytics/import_logs.py /home/degenaro/ducc/ducc_runtime/logs/webserver/* --idsite=1 --url=http://uima-ducc-demo.apache.org/piwik > /dev/null
    ===

The system administrator complains:

===
Can you please edit this cron to not send mail to root@ ? It does us no good to see these errors and just add more noise to our already busy inboxes.

2015-11-03 02:58:00,998: [INFO] Error when connecting to Piwik: HTTP Error 500: Internal Server Error
2015-11-03 02:58:00,998: [INFO] Retrying request, attempt number 2
2015-11-03 02:59:05,633: [INFO] Error when connecting to Piwik: HTTP Error 500: Internal Server Error
2015-11-03 02:59:05,633: [INFO] Retrying request, attempt number 3
2015-11-03 03:04:55,768: [INFO] Error when connecting to Piwik: HTTP Error 500: Internal Server Error
2015-11-03 03:04:55,768: [INFO] Retrying request, attempt number 2
2015-11-03 03:06:34,896: [INFO] Error when connecting to Piwik: HTTP Error 500: Internal Server Error
2015-11-03 03:06:34,896: [INFO] Retrying request, attempt number 3
2015-11-03 03:10:30,782: [INFO] Error when connecting to Piwik: HTTP Error 500: Internal Server Error
2015-11-03 03:10:30,782: [INFO] Retrying request, attempt number 2
2015-11-03 07:45:10,096: [INFO] Error when connecting to Piwik: HTTP Error 500: Internal Server Error
2015-11-03 07:45:10,096: [INFO] Retrying request, attempt number 2

I hunted with grep for where such messages may be generated without success. Can you suggest how I can prevent mail to root?

Thanks.

Lou.


#2

Answer is: use MAILTO=user@my.com in crontab.