-1

I had some cronjobs that were running 120 times per hour. 5 were scheduled to run every 5 minutes and 1 was scheduled to run every 1 minute. They sent emails to my gmail account so I could debug the issues I was having with them.

Now I have those 5 jobs every 5 minutes and the 1 job running 4,9,14,19,24,29,34,39,44,49,54,59

I think I've fixed everything, but I'm still getting error messages in my email. In particular this one is very odd, PHP Parse error: syntax error, unexpected 'us' (T_STRING) in /var/www/html/blizzard_api_access_tokens.php on line 1 as this file doesn't even exist on the server anymore.

It looks like there's a queue of cronjob emails that are being sent, but it's being throttled.

Are these emails that have been throttled and are actually errors from a few days ago? And if they are then how should I go about reading the status (and errors) of my cronjobs in near real-time?

I'm using centos7 btw.

david2278
  • 113
  • 2

1 Answers1

1

2 mails per minute doesn't sound like it should cause trouble, but if you're getting old mails you should check whether there's a queue of old mails waiting to be delivered. Most mailservers (and you haven't said what you use, so I can only give general advice) have a mailq command that can show the queue. If there's a lot of mails in the queue, you might want to just delete them, unfortunately how to do that depends quite a lot on which mail server you use.

  • I found a similar question which also mentions `mailq` and `postsuper -d ALL` found [here](https://serverfault.com/questions/737884/crontab-sends-month-old-emails?rq=1). Deleting them by running `postsuper -d ALL` is what I needed to do. Thanks. Edit: I installed apache on centos7 so whatever email server is included automatically is the one I'm using. – david2278 Oct 09 '18 at 16:55