Restart Scripts

Restart scripts

Immediate restart

Windows

:begin

"c:\Program Files\Java\jdk1.6.0_23\bin\java.exe" -Xms1024M -Xmx2048M -jar craftbukkit-0.0.1-SNAPSHOT.jar

goto begin

Unix

#!/bin/bash

while true
do
        echo starting minecraft server ...
        java -Xms1024M -Xmx4096M -jar craftbukkit.jar nogui

        echo sleeping ...

        # Do backups or something useful here

        sleep 5
done

Linux

Create a file called "run.sh" and put this code inside it:

while true 
do
java -Xms1G -Xmx2G -jar craftbukkit.jar
done

Then run it with: "bash run.sh".

Delayed Restart

This method only works for Windows users.

  1. Create a normal start-up batch script without a loop in the code like the following...

EXAMPLE (Normal Start-up Script)

"c:\Program Files\Java\jdk1.6.0_23\bin\java.exe" -Xms1024M -Xmx2048M -jar craftbukkit-0.0.1-SNAPSHOT.jar
  1. Click Start
  2. Click Programs
  3. Click Accessories, System Tools, and then Scheduled Tasks.
  4. Once open, you'll be able to create your own custom task by clicking Add Scheduled Task, which will start you through the wizard, prompting you with what program you wish to execute, how often you wish to run it (daily, weekly, monthly, one time only, when my computer starts, and when I log on), the time you wish to run, and how often each day to run.
  5. Use the wizard to select the start-up script file and select the times you would like to start back up your server...
  6. Configure Auto Shutdown plugin config to correspond

Comments

Posts Quoted:
Reply
Clear All Quotes