miércoles, 16 de diciembre de 2015

Cron job to restart asterisk at 03:00AM

- In the /root/ directory i created a file called rebootasterisk.cron by typing: 
nano -w /root/rebootasterisk.cron

- Put this into the file:
#!/bin/sh
/usr/sbin/asterisk -rx "core restart now"

Set permissions: 
chmod +x /root/rebootasterisk.cron
chmod 0777 /root/rebootasterisk.cron

Create the cron job using this command:
- crontab -e
create a new line that looks like this:
0 3 * * * /root/rebootasterisk.cron
Saved it... and Done!!!