A simple, cross-platform utility to back up multiple Minecraft servers to a specified location.
- Only backs up servers that have been changed since the last backup
- Labels backups by the time the files were last modified, not when the backup was made
This utility expects to find all of your Minecraft server folders in the same parent directory:
MinecraftServers
├───Vanilla-1.11.2
├───Vanilla-1.9.4
├───FTB-Beyond-1.7.0
├───FTB-Beyond-1.5.0
└───FTB-Skyfactory-3.0.10
The backup folder follows the same structure as the servers, however the individual server directories contain zipped backups:
MinecraftBackups
├───Vanilla-1.11.2
│ ├───Vanilla-1.11.2_2017-05-21_23-00-00.zip
│ ├───Vanilla-1.11.2_2017-05-20_23-00-00.zip
│ └───Vanilla-1.11.2_2017-05-19_23-00-00.zip
├───Vanilla-1.9.4
│ ├───Vanilla-1.9.4_2017-05-21_23-00-00.zip
│ ├───Vanilla-1.9.4_2017-05-20_23-00-00.zip
│ └───Vanilla-1.9.4_2017-05-19_23-00-00.zip
...
- Double click on the jar to generate a
config.ini
in that folder - Fill out the
config.ini
values forserversDirectory
andbackupsDirectory
as specified in Configuration options - With
config.ini
filled out, double click the jar again and a backup directory should now appear in the specified location - Confirm the servers were backed up as expected into the backups directory.
- Navigate to the directory that you want
config.ini
to be saved (usually the same directory that the jar is saved in) - Run
java -jar /path/to/mc-server-backup-util-X.X.X.jar
to generate aconfig.ini
in that folder - Fill out the
config.ini
values forserversDirectory
andbackupsDirectory
as specified in Configuration options - With
config.ini
filled out, runjava -jar /path/to/mc-server-backup-util-X.X.X.jar
again and a backup directory should now appear in the specified location - Confirm the servers were backed up as expected into the backups directory.
- Configure and test the utility using one the graphical or console installation steps above
- Open Task Scheduler by opening the run prompt or start menu and typing
taskschd.msc
and press [Enter] - Under the "Action" menu, choose "Create Basic Task..."
- Enter a name, then press "Next"
- Choose "Daily" (it can be made more frequent after creating the task), then press "Next"
- Choose the time you want to back up, then press "Next"
- Select "Start a program", then press "Next"
- In "Program/script", enter the path to
java.exe
. Instructions on finding this path can be found in How to locate your Java executable - In "Add arguments", enter
-jar "/path/to/mc-server-backup-util-X.X.X.jar"
- In "Start in", enter the path to the directory containing
mc-server-backup-util-X.X.X.jar
, without quotes, then press "Next" - Press "Finish"
- On the left column, click the folder "Task Scheduler Library", locate the name of the task that was just created, right click it, and choose "Run"
- After the program has finished, press F5 to refresh the list and check the "Last Run Result" of the task, it should be "The operation completed successfully. (0x0)", if it doesn't it didn't work correctly.
NOTE: If you prefer the script to run without a console window popping up, use javaw.exe
instead of java.exe
in step 8.
Option name | Default | Description | Examples |
---|---|---|---|
serversDirectory | - | The location of the folder containing the server folders. | ../servers , C://mc/servers , /home/user/servers , \\\\computer/shared |
backupsDirectory | - | The location of the folder containing the backup folders. This directory will be created if it does not exist. | ../backups , J://mc/backups , /home/user/backups , \\\\computer/shared |
logLevel | CONFIG | The minimum level of log messages to show in the console. From highest to lowest: ALL , SEVERE , WARNING , INFO , CONFIG , FINE , FINER , FINEST , OFF |
NONE , INFO , SEVERE |
- Open the run prompt or start menu and type
cmd
and press [Enter] - In the console that opens, type
where java
, this will display all paths to your installed Java directories (there may be more than one). The Java executable should be in thebin
folder in the listed directories.
NOTE: If multiple directories are listed from where java
you're not sure which one to use. Try typing echo %JAVA_HOME%
and using that directory, though that environment variable may not exist, depending on how Java was installed.
This project includes preconfigured ANT versioning and packaging options.
To display the current version used by ANT:
ant
To package the current version into a jar:
ant dist
To change the version and package the current version into a jar:
ant revision (or ant major or ant minor)
ant dist
Note that changing the version and packaging the jar must occur as two separate ANT operations.