Jump to content

Question

4 answers to this question

Recommended Posts

  • 0
Posted
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 :D

  • 0
Posted

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.
 

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...