Disable cron emails

Disable cron emails

by Nathan Bruley -
Number of replies: 4

How do I disable automated Moodle cron emails?

I'm using Moodle 2.6.3.

Typing crontab -e tells me I don't have a cron file, so I must not be doing something right?

Average of ratings: -
In reply to Nathan Bruley

Re: Disable cron emails

by Joshua Bragg -

Perhaps you created the entry under a different user?

In any case, my crontab on CentOS has a MAILTO command that I've left blank.  

Alternatively you could just add in >/dev/null to the end of the cron entry

In reply to Joshua Bragg

Re: Disable cron emails

by Nathan Bruley -

Ah, they're user specific. I didn't set it up, so I'll see if the other user has this file. Thanks!

In reply to Joshua Bragg

Re: Disable cron emails

by Nathan Bruley -

So I found a user with a cron job enabled and we added the MAILTO command above it and that didn't work. We commented out the cron job completely and still get an email every minute (the cron job was set to run like every 15 minutes so I'm wondering if it's the same thing...)

The cron email references /usr/bin/php /var/www/moodle/admin/cli/cron.php

I wonder if I need to disable an email command in that PHP file?


Edit: I didn't have them log in as root. Going to try that.

In reply to Joshua Bragg

Re: Disable cron emails

by Nathan Bruley -

Finally figured it out.

Needed to use the www-data user for Apache and add >/dev/null to the end of that.

$ sudo crontab -u www-data -e


Average of ratings: Useful (1)