[CLOSED] Where is the cron job that is sending out emails to asterisk@

Hi. I copied my Rasp Pi SD card with Asterisk/FreePBX from a Pi Zero to a Pi 4 and tried to upgrade but this failed and I eventually gave up and uninstalled on the Pi 4 but had meanwhile also installed lots of other non Asterisk/FreePBX stuff.

However, there is a cron job that is still running and sending emails to a non-existent asterisk@. This caused my ISP to suspend my send email account due to the high number of bounces.

Problem is that I cannot find that cron job to delete it. I set up a temporary forward for asterisk@ and now I’m getting 100’s of cron error messages as the Asterisk system has been removed.

I deleted all the folders called asterisk[*] and a file called /var/spool/cron/crontabs/asterisk

I’m sure the emails are coming from the Pi 4 as they are sent by asterisk@<my Pi 4 system ID>

I tried:
sudo nano /etc/crontab
only has
MAILTO="<good email>@<my domain>"
and
sudo crontab -e
and it has no MAILTO=

Suggestions welcome.
Alan

Look in /var/spool/cron/asterisk

Many thanks for your help. Unfortunately there is no /var/spool/cron/asterisk

/var/spool/cron/ only contains crontabs directory, and that only has root. Root contains only my cron definitions.

Alan

This is really an OS question, as cron is part of Linux, not FreePBX. cron will only look for work in the standard places for your distribution.

1 Like

Well as far as I know, I have looked in the standard places. The issues arises (it seems to me) that Asterisk created the cron job but the uninstall did not remove it.
So whilst not directly related to FreePBX, many (most?) FreePBX experts are also Asterisk experts. I did look at the Asterisk Community but it seemed less user friendly (to use) and be aimed at support from Sangoma.

Actually, I’ve no cron emails today so maybe the issue has been resolved and yesterday’s 50+ messages were being delivered rather late. If I get no messages tomorrow I will close this thread.

cron jobs are normally logged to /var/log/syslog (aka messages)

Also, I would assume other cronjobs would be somewhere in /etc. Perhaps do:
find /etc -name ‘cron*’
and see what is there?

Thanks for the suggestion. That produced nothing. I am no longer getting emails so I presume the problem is fixed - see below

cron jobs are normally logged to /var/log/syslog (aka messages)

Thanks for the suggestion. That produced only 9 lines all to do with dbus.service errors. I am no longer getting emails so I presume the problem is fixed - see below

I am no longer getting emails so I presume the problem was fixed when I deleted the many asterisk directories that remained after the uninstall.

There must of been numerous emails at the ISP still to be delivered; maybe pending after the account was suspended.

I was a good job it was not one of my main email accounts and shows the benefits of having accounts for specific purposes.

Thanks to all those that replied to this posting. I will now mark it closed.

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.