How to restart asterisk daily

Hello everyone,

I am new to this post and somewhat to asterisk so please bear with me.

Like to know how I can setup a cron job to restart asterisk daily (or every other day)

I have Ubuntu:

No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 11.10
Release: 11.10
Codename: oneiric

this does not work for me

0 5 * * * /etc/init.d/asterisk -r -x “restart gracefully” >/dev/null 2>&1

thanks in advance,
tony

create a php script or AMI application using (core restart now ) and call that script in CRON TAB…

/etc/init.d/asterisk restart gracefully should be enough

This has nothing to do with DUNDI. You should have used Asterisk Support.

With -rx, you must use the actual name of the Asterisk executable (normally /usr/sbin/asterisk). The startup script only takes one parameter, so if you do it that way, you want restart without the gracefully. It will never do a graceful restart.

Why do you want to do this? If this is because you think memory is getting corrupted, you should only use the startup script and you should not try and do a graceful restart, as the corruption may prevent the shutdown needed for this.

Most people would only need something like logger reload.