7

I am facing an issue with Ubuntu server. I am running a PHP script using a cron job which executes every 5 minutes. This folder spool/mqueue is showing 112GB space. The scripts job is to fetch data from MySQL. If there is no data it will show an error. Now there is an error and cron is trying the send the mail to the users where user email is not defined and it is creating log file in mqueue folder.

How to customize cron so that it would not send mails and write logs?

1
  • 1
    What is the 'ubuntu space issue' if you only want cron to shut up?
    – aquaherd
    Jan 25, 2013 at 9:22

1 Answer 1

19

You can set the MAILTO variable in your crontab.

Just type the following at the top of your crontab (crontab -e):

MAILTO=""

and cron will not send any mail for any of the jobs. If you have to disable mails for a specific task, use the following:

@hourly /path/to/script.sh >/dev/null 2>&1

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .