Want a better Minecraft server? Read about SpigotMC here!
Separate names with a comma.
Discussion in 'Systems Administration' started by MatthewKai, Jun 3, 2017.
Hello Im using centos 7 so how do i go about setting up a daily server restart?
It depends on what you are using to run your servers.
You could use a bash script coupled with a plugin or can use one of those server monitoring softwares.
Why in the hell would you want to restart CentOS? Server distros like that are built to run for litterally years at a time, if you are wanting to setup auto restarts of the minecraft server, there are plenty of plugins out that that can do that, I suggest googling
You can use Crontab =>
Run your reboot command at specified time every day
i mean restart my minecraft server using centos 7 not restart centos 7 itself
Off the top of my head can't you run a cronjob to start and stop the server every 24 hours?
Just use an auto restart plugin, it'll be a lot easier than using cron. If you really want to though, here's something from the top of my head:
00 00 * * * root screen -X -S hub1 quit
00 00 * * * root screen -dmS hub1 sh java -jar /home/mc/hub1/spigot.jar
Obviously this probably isn't exact and you'll need to tweak it anyway. And you gotta be using screen for this