Skip to content

Automated Backups

spike grobstein edited this page Aug 18, 2013 · 2 revisions

Doing automated backups with mcwrapper is a piece of cake. Depending on what platform you're running your server on, the task may differ. On the most popular platforms (OSX and mainstream distributions of Linux), you'd want to use cron.

To set up a daily cron job to back up your world data, you can do the following on your commandline when logged in as the user that's running the minecraft_server:

$ crontab -e

From there, a text editing session will be opened in your system's text editor (usually nano or vim; if you don't know how to use this, Google around for some tutorials). You'll want to add something like the following on a single line:

MCWRAPPER_CONFIG_PATH=/path/to/mcwrapper.conf
* 2 * * * $MCWRAPPER backup 2>&1 | logger -t mcwrapper

Replace $MCWRAPPER with the path to your mcwrapper executable (eg: /usr/local/minecraft/mcwrapper). Also, replace /path/to/mcwrapper.conf with the path to your mcwrapper.conf file. That line may not be necessary if you've got mcwrapper.conf in a "standard" place (TODO: write info on this).

The above crontab lines will do a backup of your Minecraft world data every day at 2AM (server-time) and will pipe the output (including STDERR) of the command to syslog with the tag mcwrapper. This can be useful for troubleshooting and auditing past backups.

You may want to read up more on cron and the crontab if you want to do anything more complex.

Clone this wiki locally