How would I go about creating daily scheduled restarts for game server (s)? I'm using centos 5.4 and read something about init.d scripts. Not sure if that's the way to do and it's confusing
So, what's the best method to do this?
scheduled restarts
-
- A semi-regular
- Posts: 20
- https://www.youtube.com/channel/UC40BgXanDqOYoVCYFDSTfHA
- Joined: Thu Jan 01, 2009 3:10 am
Re: scheduled restarts
I mean, what's the best way to create scheduled restarts for game servers? I'll be running quake 3 servers.
Re: scheduled restarts
One way that you could do this is with a crontab entry that kills everything matching the name of your process. For instance, if your q3 process is named "q3ded", then you could edit your crontab through "crontab -e" and add something like this to restart everything at 5am:
0 5 * * * killall q3ded
0 5 * * * killall q3ded
Re: scheduled restarts
Thanks for the reply. I figured out a way to do scheduled restarts but I dislike that crontabs don't allow for running processes in seconds. After looking around online I've come to a conclusion that I'll need to learn how to do init scripts because I don't really like waiting 1 minute for my servers to be restarted and prefer it to be done in a few seconds.
So, where would I learn about init scripts? I've been searching around online and there are a lot of guides to help me but most of them aren't good.
John, if you don't mind me asking. I would like to know how NFO does scheduled restarts for game servers.
So, where would I learn about init scripts? I've been searching around online and there are a lot of guides to help me but most of them aren't good.
John, if you don't mind me asking. I would like to know how NFO does scheduled restarts for game servers.
Re: scheduled restarts
You can easily compensate for not having second granularity. Just put a "sleep" statement in before the statement you want to execute to have it happen at whatever part of the minute you want. Want it to happen 5 seconds before the next minute? Just use something like this:crs4380 wrote:Thanks for the reply. I figured out a way to do scheduled restarts but I dislike that crontabs don't allow for running processes in seconds. After looking around online I've come to a conclusion that I'll need to learn how to do init scripts because I don't really like waiting 1 minute for my servers to be restarted and prefer it to be done in a few seconds.
Code: Select all
0 5 * * * sleep 55 && killall q3ded
I'd recommend looking at the init scripts provided by the OS as examples. I have not looked into it before, so I can't think of a good reference for them.So, where would I learn about init scripts? I've been searching around online and there are a lot of guides to help me but most of them aren't good.
We script it. Stop, wait, start again.John, if you don't mind me asking. I would like to know how NFO does scheduled restarts for game servers.
Re: scheduled restarts
Ah, I see. Thanks.