Cron job keeps sending me emails - How to stop?

Scorpion Ghost

Elite Member
Executive VIP
Jr. VIP
Joined
Mar 22, 2013
Messages
9,153
Reaction score
10,492
I'm hosted on Hostgator. Earlier today I set up a cron job for something, to run every 30 minutes. But every time it runs it keeps sending me emails. I figured it would take me 2 minutes to stop it, but to my surprise when I searched on Google and Youtube I didn't get anything (nothing I could understand how to implement anyway).

Preferably I'd like the emails to not be sent, unless there's a problem. Then I'd like to receive the email.

But if not possible, I don't care, I'd like to stop emails being sent to me when cron runs.

How can I do this?

Thanks
 
For example we have this - https://www.garron.me/en/bits/stop-cron-job-from-sending-email.html

And he says:

If you need to stop cron from sending emails, just add this to the end of the line in cronjob file.

Edit that file with crontab -e and then add this to the end of the line: > /dev/null 2>&1


Where is the end of the line in cronjob file? Where is the cronjob file? In file manager?
 
what he means is that you need to login via SSH and execute the crontab -e command to edit and then append "> /dev/null 2>&1" to each line.

I have no idea what SSH is or how to login with it. II have no idea how to execute the crontab -e command, and, yeah. No idea how to do that. haha..
 
then maybe contact your hosting support they should be able to help you :)
 
then maybe contact your hosting support they should be able to help you :)

I'm actually doing that right now. They gotta earn their pay :p

Thanks :)
 
no problem, good luck :)
 
I believe you added the CronJob via cPanel right?

If yes, Edit your cron job and add the following command to the end of it.

Code:
>/dev/null 2>&1

so it looks like

Code:
/public_html/yourcommand.php >/dev/null 2>&1

It should stop CRON from sending you emails.

Give it a try and update your results.
 
I believe you added the CronJob via cPanel right?

If yes, Edit your cron job and add the following command to the end of it.

Code:
>/dev/null 2>&1

so it looks like

Code:
/public_html/yourcommand.php >/dev/null 2>&1

It should stop CRON from sending you emails.

Give it a try and update your results.

Bro yeah, that was it. So simple. The guy on Hostgator support hooked me up. Stupid huh :D

Thanks though. That's it, that works! :)
 
Back
Top