Title Image

Owner’s Corner: Incremental Map and Plugin Backups

Backing up the maps and configs isn't a simple task. If you figure that the entire server folder is just about 8GB in size currently, it takes a long time to just copy a file over to a backup. Now, figure every time you make a change to an area, or grass grows, or a mob lays an egg, or you drop an item...it changes the chunk file. It's to the point that if done incorrectly, the backup contains files that are actually 5-10 minutes apart from each other in age. This isn't good for anyone.

The solution is to only copy files that have been changed since the last backup, and linux provides some utilities to do that. Cnc wrote a pretty good script to take care of this incremental backup, and it's the system we still use. There's 2 interesting principles at use here:

  1. Archive copying, instead of true copying. Basically, if I copy file 1 to file 2, it doesn't actually make a second copy, it creates a link. Then, if file 1 is deleted, the actual file isn't deleted but preserved with file 2 being the owner. To actually delete the data, you have to delete file 1 AND file 2.
  2. Rsync bit-by-bit incremental backing up. Rsync looks at the file's hash to see if any data in the file is changed, and only makes a backup if the file is changed.

So, let's see what the script looks like:

Spoiler Inside SelectShow

So that's the deal, so far so good, and once we get the new server and throw in the 1.5TB hard drive, we'll be keeping backups FOR EVER. I may write a for loop for that folder moving scheme. Just for the record, our current 60 backups take up 51GB...imagine how many we'll be able to keep :O