[Asterisk-Users] Help with Cron and Reload

JD Austin jd at twingeckos.com
Wed Jun 15 12:41:38 MST 2005


Heres what I use; I have asterisk restart if the net is down and once a 
day just before 7am:
crontab -e:
55 6 * * * /usr/sbin/asterisk -r -x "restart gracefully" >/dev/null 2>&1
5,10,15,20,25,30,35,40,45,50,55 * * * * /root/scripts/check_net

/root/check_net
#!/usr/bin/perl
$net=`/bin/ping -c 02 google.com 2>&1 | /bin/grep -c 'unknown host'`;
if ($net==1) {
print `/bin/date`;
print `/usr/sbin/asterisk -r -x "restart gracefully"`;
}


Federico Alves wrote:

>This will sound weird but the command  'asterisk -r -x reload' fails to work
>when issued by Cron. But it works when I issue it from a bash session. What
>is not configured correctly? I need to refresh the configuration every a
>short amount of time.
>
>rom root at localhost.localdomain  Wed Jun 15 18:42:00 2005
>Date: Wed, 15 Jun 2005 18:42:00 -0400
>From: root at localhost.localdomain (Cron Daemon)
>To: root at localhost.localdomain
>Subject: Cron <root at ashish> asterisk -r -x reload
>X-Cron-Env: <SHELL=/bin/sh>
>X-Cron-Env: <HOME=/root>
>X-Cron-Env: <PATH=/usr/bin:/bin>
>X-Cron-Env: <LOGNAME=root>
>
>/bin/sh: line 1: asterisk: command not found
>
>Any ideas?
>
>
>_______________________________________________
>Asterisk-Users mailing list
>Asterisk-Users at lists.digium.com
>http://lists.digium.com/mailman/listinfo/asterisk-users
>To UNSUBSCRIBE or update options visit:
>   http://lists.digium.com/mailman/listinfo/asterisk-users
>  
>

-- 
JD Austin
Twin Geckos Technology Services LLC
email: jd at twingeckos.com
http://www.twingeckos.com
phone/fax: 480.288.8195 




More information about the asterisk-users mailing list