Web Hosting UK Posted April 9, 2017 Report Posted April 9, 2017 When I setup the cron within my cpanel I did not apply an e-mail address but im getting an e-mail address to my admin@ every 5 minutes, if they a way to stop e-mails been sent? Quote
2 Michael Posted April 9, 2017 Report Posted April 9, 2017 You need to remove the email address if you can from the cronjob top bit or add >/dev/null 2>&1 to the end of the cronjob task Eg: /usr/local/bin/php /home/username/public_html/index.php cron >/dev/null 2>&1 Web Hosting UK and activa 2 Quote
0 Web Hosting UK Posted April 9, 2017 Author Report Posted April 9, 2017 19 minutes ago, Licensecart said: You need to remove the email address if you can from the cronjob top bit or add >/dev/null 2>&1 to the end of the cronjob task Eg: /usr/local/bin/php /home/username/public_html/index.php cron >/dev/null 2>&1 Thanks, only had it for a week and had over 2500 e-mails activa and Michael 2 Quote
0 Michael Posted April 9, 2017 Report Posted April 9, 2017 15 minutes ago, BWDHS said: Thanks, only had it for a week and had over 2500 e-mails haha at least you know the cron was working. Web Hosting UK 1 Quote
0 DigitalSparky Posted April 16, 2017 Report Posted April 16, 2017 Just to quickly add to this one, > /dev/null 2>&1 pipes everything to the abyss, which means you'll even lose errors. you may wish to remove the 2>&1 so you still get emails if there is an error, it may be helpful in the event errors occur, instead of silently failing :). FYI: >/dev/null = Pipe standard out to /dev/null 2>&1 = Pipe standard error to standard out, which in turn pipes to /dev/null so removing 2>&1 means stderr (standard error) will still come through, so you'll get emails in the event of errors, otherwise not. there are other ways to monitor your systems to ensure errors are picked up quickly, but they vary widely in complexity depending on requirements, so this is a rather simple approach, but can still be effective. YMMV, but monitoring, logging, trend analysis, etc will help considerably with bug and outage detection, allowing you to maintain higher uptime and business continuity. Web Hosting UK 1 Quote
Question
Web Hosting UK
When I setup the cron within my cpanel I did not apply an e-mail address but im getting an e-mail address to my admin@ every 5 minutes, if they a way to stop e-mails been sent?
4 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.