I’m trying to get cron to run a bash acript to pull out an iax registration we have so I can detect when we lose connection with our voip provider.
The following minimal script shows where my problem is (it’s running on Centos 5)
asterisk -r -x “iax2 show registry” >/root/log
The script has execute rights for user group and other and works as expected when run interactivly by the root account. However, when run via cron, it leaves a zero length file behind and no error messages that I have been able to find. The job was added to cron via crontab as user root with the following line
*/1 * * * * /root/check-asterisk
I have hunted through google but have not found any answers.
If anyone has any ideas on whats happening, it would be appreciated.