Page 1 of 1

Schedule for Server Reboot

PostPosted: Mon Nov 19, 2012 11:21 am
by benghoi
Hi Guys,

Do you have any idea how to set a schedule that will restart the server by itself?

I found this in crontab but i know what is this mean and the format:

### Reboot nightly to manage asterisk issues and memory leaks - uncomment if issues arise
30 6 * * * /sbin/reboot

Question:
What is the meaning of 30?
meaning of 6?

Can you provide me a format for this:
I want the server will restart at 10:30pm. - sample only.

Thanks!

Re: Schedule for Server Reboot

PostPosted: Mon Nov 19, 2012 1:06 pm
by GaD
Here's a link to my good 'ole friends of Cyberciti:

http://www.cyberciti.biz/faq/how-do-i-add-jobs-to-cron-under-linux-or-unix-oses/http://www.cyberciti.biz/faq/how-do-i-add-jobs-to-cron-under-linux-or-unix-oses/

Code: Select all
* * * * * command to be executed
- - - - -
| | | | |
| | | | ----- Day of week (0 - 7) (Sunday=0 or 7)
| | | ------- Month (1 - 12)
| | --------- Day of month (1 - 31)
| ----------- Hour (0 - 23)
------------- Minute (0 - 59)

Re: Schedule for Server Reboot

PostPosted: Mon Nov 19, 2012 1:29 pm
by williamconley
30 22 * * * /sbin/reboot

this will reboot at 10:30PM (2200 hrs, 30 minutes)

Re: Schedule for Server Reboot

PostPosted: Tue Nov 20, 2012 2:09 pm
by benghoi
Thanks guys, its working.

Re: Schedule for Server Reboot

PostPosted: Wed Nov 21, 2012 5:28 pm
by spacejanitor
One note from me - if running a cluster, I have all the servers set to the same reboot time (in my case, 3:00AM), but I have the DB server set to reboot 5 minutes prior to the other machines so that when they are back online, the DB is already ready to roll and there are no "surprises".

Re: Schedule for Server Reboot

PostPosted: Wed Nov 21, 2012 5:35 pm
by benghoi
Thanks Spacejanitor for the note. I also did the same way. I let my DB reboot 20mins before my asterisk will reboot. But one of my problem is, after reboot the servers, are they automatically Sync to each other? because we encountered in the middle of operation, there is a message will pop up: Synchronization Error. And if this happen, the recordings will mess up.

Re: Schedule for Server Reboot

PostPosted: Wed Nov 21, 2012 5:41 pm
by spacejanitor
benghoi wrote:Thanks Spacejanitor for the note. I also did the same way. I let my DB reboot 20mins before my asterisk will reboot. But one of my problem is, after reboot the servers, are they automatically Sync to each other? because we encountered in the middle of operation, there is a message will pop up: Synchronization Error. And if this happen, the recordings will mess up.


Do you mean sync their NTP? If so, what I have is one server (in my case the DB) which syncs with a government NTP server, and then the remaining servers have their NTP server setting set to the DB server. So the DB acts as a sort of master NTP and the remaining servers are slaves to it.

However, if you are getting time sync errors it isn't necessarily because of this. I've had time sync errors occur from all kinds of things, such as network bottlenecks/latency and even a sluggish or full HDD on one of the telephony servers.

Re: Schedule for Server Reboot

PostPosted: Wed Nov 21, 2012 6:35 pm
by benghoi
i also have the same setup for the NTP. My DB is the NTP server then the rest servers are sync to DB. All of my server has 500GB but the recordings will be send to FTP Server