So, I want to create a batch file for my Minecraft Server to startup and then restart the server at the end of each day (midnight, preferably, but 24-hour period works as well)
This is my startup batch, which calls other batch files to open and start the servers individually:
start cmd /k call BungeeStartup.bat start cmd /k call HUBStartup.bat start cmd /k call PvEStartup.bat start cmd /k call PvPStartup.bat start cmd /k call MinigamesStartup.bat start cmd /k call TownyStartup.bat start cmd /k call SecQStartup.bat
And each "Startup.bat" calls to run the server like this:
D: cd Minecraft 1.12 Server Files cd BungeeCord <-- and each it's respective server, of course, so I don't have to type it all out again RUNGEE.bat
And, finally, the RUN.bat files look like this:
java -jar -Xmx350M spigot-1.12.2.jar -o true
And that starts all of my servers up in different command prompts. But the issue is, there's no way (that I know of) with this to end the servers without me manually typing /stop into each command prompt server, and then 'exit' into each command prompt again to exit it. Then I have re-execute the batch file manually as well.
So, my questions are:
- How do I (with the batch files) end each server, and then each command prompt window, without doing it manually
- How do I re-start them automatically after they exited.
- AND how to get this specifically to happen once every 24 hours (or, preferably at midnight each night)
So, to clarify how the Minecraft server works, I'm adding this edit.
When you startup a server, obviously it runs the server and everything and people can connect and play. It has a command prompt that you use to execute commands and see information and all that. In order to properly shut-down the server to where it saves everything and doesn't corrupt files, you type 'stop' into the command prompt. Then it exits out of the server and normally would exit the command prompt for you to re-open as willing. Then, with the batch files I have set up, it doesn't just exit the command prompt after typing 'stop', it returns you to the directory for you to continue using the command prompt as if it's not running the server anymore (because it isn't), and you have to type 'exit' to close the command prompt.