Hi,
looking for some advice please.
I'd like to set up a cron job to monitor the length of the exim queue and email me if it gets over X number of emails.
At present I'm just running a simple test to email me the queue length. I've followed the instructions in this post: Exim queue size - auto-mail to myself but I can't get the queue length to show in the email when run as a cron.
I have a file: /home/username/crons/mailqueue.sh
which contains:
#!/bin/sh
/usr/sbin/exim -bpc | mail -s 'Exim queue size' [email protected]
This works if I run it from the command line with ./mailqueue.sh and I receive an email with the current number of emails in the queue.
When I try and run it from a cron using:
sh /home/digital1/crons/mailqueue.sh
I get a blank email.
/var/log/cron isn't helping as I just see the cron run.
The thread above suggests a pathing issue and to use the full path to exim which I have but still no luck. I'm hoping it's something really simple I'm, missing.
Thanks for your help.
Hedley
looking for some advice please.
I'd like to set up a cron job to monitor the length of the exim queue and email me if it gets over X number of emails.
At present I'm just running a simple test to email me the queue length. I've followed the instructions in this post: Exim queue size - auto-mail to myself but I can't get the queue length to show in the email when run as a cron.
I have a file: /home/username/crons/mailqueue.sh
which contains:
#!/bin/sh
/usr/sbin/exim -bpc | mail -s 'Exim queue size' [email protected]
This works if I run it from the command line with ./mailqueue.sh and I receive an email with the current number of emails in the queue.
When I try and run it from a cron using:
sh /home/digital1/crons/mailqueue.sh
I get a blank email.
/var/log/cron isn't helping as I just see the cron run.
The thread above suggests a pathing issue and to use the full path to exim which I have but still no luck. I'm hoping it's something really simple I'm, missing.
Thanks for your help.
Hedley
Last edited: