Stopping Multiple Servers

Discussion in 'Server & Community Management' started by Connor_13_, Jun 18, 2013.

  1. Is there a way to use a shell script to save and then stop multiple minecraft servers at once?

    Thanks for any help!
     
  2. I have my servers do this via shell scripts every 24 hours. I have physical hosts but they share an NTP server so it happens all at the same time. You pretty much just have to send the command:
    Code (Text):
    save-all
    wait 5
    Code (Text):
    stop
    then have the script execute your startup script
     
  3. What does the saving / stopping script look like?

    I know how to start the server. Here is how I do it.

    Code (Text):
    #!/bin/sh
    screen -dmS Lobby java -Xincgc -Xmx4G -jar spigot.jar
    It creates a screen called lobby for the Lobby server. I have 2 more screens like this.

    How would I save and stop all of the servers running on the screens?

    EDIT: All my servers run on one machine
     
  4. Code (Text):
    screen -p 0 -S lobby -X eval 'stuff save-all\015'
    wait 5
    screen -p 0 -S lobby -X eval 'stuff stop\015'