Prerequisites:
Dropbox (Or, you can use my referall link, which will get me extra Dropbox storage space.)
Link Shell Extension
7-zip Command-Line Version(Other archival software may work, but I will include a script that uses 7-zip command-line functions)
Dropbox:
- Install Dropbox on your PC, and create a new account if you haven't already. The free 2GB account will be more than sufficient.
- Navigate to your Minecraft installation directory (Windows: %appdata%\.minecraft, Linux: ~/.minecraft, Mac: ~/Library/Application Support/minecraft)
- Move the entire .minecraft folder into the Dropbox folder (Windows: My Documents\Dropbox, Linux: ~/Dropbox)
- As the files are moved, you will notice that the Dropbox icon in your notification area (system tray) will indicate that the files are being uploaded. That's the great thing about Dropbox, all files placed into it are automatically backed up to their servers.
Link (Windows Only):
- Install the Link Shell Extension.
- Right-click the .minecraft folder that you moved to your Dropbox folder, and select "Pick Link Source"
- Navigate back to the original installation directory that minecraft was in (EG, %appdata% on Windows)
- Right-click an empty area in the window and select "Drop As" -> "Junction". This will create a link to the .minecraft folder that you just moved to your Dropbox, so you can still play Minecraft, and all changes made to your save data will automatically be stored on Dropbox's servers
NOTE: Linux users can accomplish similar using "ln". Read the man-page to learn more. Mac OS X should also have a similar command. See the Linux spoiler section, below!
7-zip Archiving (Windows Only)
This last step is optional, but recommended, as there may be situations wherein you will want an added layer of back-up for the possibility that Dropbox becomes unavailible, or the copy of your world uploaded to Dropbox is broken as well.
- Open the 7-zip command line archive, and copy the 7za.exe file to your system path (EG: C:\WINDOWS\)
- Open Notepad (Or your prefered text-editor that can save Windows Batch files [*.bat])
- Copy the following into Notepad:
Code: Select all
@echo off
:: This script is to automatically create a zip archive of Minecraft save data.
:: Written by ReDrew89
cd "%appdata%/.minecraft/"
7za a -tzip saves.zip saves -r -mx0
exit
- Save the file using "File -> Save As...". Make sure in the Save file dialog, you select "All Files" as the type, and name it whatever you please, just be sure to include the .bat extension.
- Now, go to Start -> All Programs -> Accessories -> System Tools -> Scheduled Tasks
(Linux users can create a cron job for the same effect. I won't go into details, because cron is pretty complex. Remember, always read the man-page)
- Create a new sceduled task, to run the script you just saved. Have it run at a time where you know your computer will be on, and Minecraft won't be running.
That's it! You will now have automatic archiving on your saves directory, which will also be uploaded to Dropbox on the fly.
Other Notes:
This is where users who have attempted these steps can point out differences between separate platforms.
General Knowledge/Tips:
SterlingRed wrote: Sometimes a corrupted world caused by a crash or a power loss can be recovered from a recent backup without having to roll back the entire world to whatever your last backup was. Often when a world gets corrupted, replacing the level.dat file fixes the issue. Copying the level.dat from your most recent backup, will revert your player location and inventory but the contents of your world will be from whenever Minecraft last saved the chunks.
Mac OS X:
Yamboyz1 wrote:If you have Mac OSX Lion, you're unable to access the "Library" folder in your files. The only other way to access it besides downloading a program that brings it back is to click "Go" under the menu bar then type ~/library/application support/minecraft then press enter. Or what have you.
chaoticneutral wrote:Updates for Linux section.
1. Installing Dropbox from the repositories will give you less headaches than from the site. For .deb (Debian, Mint, Ubuntu) distros, a simple "sudo apt-get install dropbox" without quotes in the terminal will install it and the dependencies - similar methods are avaliable for .rpm and other distros.
(Of course, you can use Synaptic or App Center if you're uncomfortable with command line.)
2. The command "dropbox" will open the CLI; it's easier to set up from the GUI (Menu > Internet > Dropbox).
3. A cronjob isn't needed for the program itself - just configure the program for your user, it'll start on itself when the desktop environment starts. Let it run, it won't annoy you.
4. I wouldn't recommend symlinks. Murphy's Law says Dropbox will try to sync while you're running Minecraft. There's a boring way to solve this (compress manually your worlds and drop the archive into Dropbox dir), and there's the Linux way - do a bash script to do the work for you. I'll show mine, adapt it to your needs:
Yes, this runs Minecraft in the end - I launch the game from it to avoid forgetting run the script. Remember to set it to executable.Code: Select all
#!/bin/sh # In order: delete oldest backup, move old to oldest, create new backup, start Minecraft rm ~/Dropbox/mcsavegames.tbz.old mv ~/Dropbox/mcsavegames.tbz ~/Dropbox/mcsavebackup.tbz.old tar -cjvf ~/Dropbox/mcsavegames.tbz ~/.minecraft/saves/ minecraft