peace_love
peace_love

Reputation: 6461

How can I disable Cronjob Emails?

I would like to disable my cronjob from sending me Emails.

My cronjob is executing a php file.

At the top of this file I wrote:

#!/usr/bin/php
<?php 
$ crontab -e
MAILTO=""

But this is not helping.

I also tried

#!/usr/bin/php
>/dev/null 2>&1.

Upvotes: 1

Views: 1557

Answers (1)

Daniel E.
Daniel E.

Reputation: 2480

With putty connect to your server.

In the command line :

crontab -e

It will open you cron in editor. If it's vi the editor by default, Press "i" to insert mode. Then put on the first line

MAILTO=""

Press "Esc" to stop insert mode and ":x" to quit and save.

If you don't know how to connect to your server, you need to contact your sysAdmin.

Upvotes: 2

Related Questions