- 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"
/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
- crontab -e
create a new line that looks like this:
0 3 * * * /root/rebootasterisk.cron
0 3 * * * /root/rebootasterisk.cron
Saved it... and Done!!!