Auto-Backup

Discussion in 'Bukkit Help' started by Speedy, Jan 4, 2011.

Thread Status:
Not open for further replies.
  1. Offline

    Speedy

    Now it's probably asked for in the plugins or whatever, but I couldn't find a proper thread about it.

    Either way, I think I'm about right when I say that alot of server administrators have a use for a proper backup system.

    However.. I dont want this in a plugin. This simply HAS TO BE a core-functionality of Bukkit. To this day I have no idea why hMod and most other server OSes/wrappers did NOT have this.

    I mean, come on, most of us want this, right? I dont care much for automated mapping (though it'd be handy) but at least backing up the world automatically..?

    This is the one thing I'd really like to see in an server OS.
     
  2. A crude backup function is not that hard to implement. Just copy the entire world folder to a specified directory with a name based on current time.

    The problem is that the server world can get very large. The server I'm on is not that big, and the world is ~180mb with 45000+ files in total.
    Copying that every time is expensive in both time and storage, especially if the hard drive is not the best.
    So to do it right it has to bee some kind of incremental backup, with an option of making a full backup and starting new incremental backups from there.

    I'm trying to implement this in the C# wrapper I'm making and it's not exactly trivial, but definitely doable.
     
  3. Offline

    Tibs

    (in *nix land)

    rsync
    rsync -av /src/foo/ /dest/foo

    Don't copy the entire world folder every time, just use rsync.
    rsync to a backup folder, then archive that backup folder to create snapshots.
    You can use the output of rsync to create list of files that have changed since the last time it was run.
    Do the initial rsync, make a tar.gz of that backup folder.
    Then each time you run rsync, you only need to archive the files that have changed.
     
  4. Offline

    root

    Yes, rsync.

    Though you should ALWAYS download your backup so you have a copy at home, too - having a backup stored on the server is pretty useless if the server's HD melts or the rack goes up in flames.

    Edit: Also, around 1 full backup each week is good - then move that one to the archive and make a new full backup to incrementally add to. Store all your backups at home on CDs or something :)
     
  5. I run hourly backups via cron.
    Here is my little script to do so (in case someone wants it):

    Code:
    #!/bin/sh
    cd /home/username/World_Backups
    mkdir `date +"%Y_%m_%d"`
    cd /home/username/World_Backups/`date +"%Y_%m_%d"`
    tar -cf World1_`date +"%Y_%m_%d__%H_%M"`.tar /home/username/path_to/Minecraft_Server/bin/World1
    gzip World1_`date +"%Y_%m_%d__%H_%M"`.tar
    * Replace the folders with your preffered folders
     
  6. Offline

    Speedy

    So, let me get this straight, you all PREFER doing it manually?

    I'm asking for something quite reasonable, especially if it is, as mentioned 'not hard to implement'.
     
  7. Well, actually i do.
    And it's not manually.. Cron does it hourly :)
    But i support your request.
     
  8. Offline

    Gussi

    If this becomes a "core feature" there better be a way to turn it off :) I honestly wouldn't trust the minecraft server itself to take backups, call me old fashion but I like to do it manually, and by "manually" I'm talking about rdiff-backup in cron :p
     
  9. Offline

    Killie01

    manual updates 4 ever :)
    and for my BSM not :D
     
  10. Offline

    TnT

    Agree entirely with the OP here - needs a built in backup system.

    Currently on my Ubuntu server I have it running a simplebackup job (for you GUI lovers, this is a stupid easy program to use) which SSH's it to another VM (running on a separate HD). On top of that, I have it setup to rsync the backups over to a buddies server as well.

    The city I live in would need to get nuked for me to lose more than an hour of time on my server.
     
  11. Offline

    Obsidian

    Email it to yourself. Gmail's got plenty of space.

    That or you can do something like Amazon S3.
     
  12. Offline

    root

    It's always better to have a local copy too. What happens if your server goes down and for some reason you only have limited internet access? Or if somebody steals your private key (and figures out your password) and everything gets compromised? You can use these methods too, but it's always good to have a read-only version at home that can't be accidentally deleted and can be restored quickly.

    Another tip is to write (and test!) a script for restoring from backups - doing it manually can take time, especially if you're incrementally backing up and need to restore each tar archive yourself.
     
  13. Offline

    Speedy

    This is all more reason to ask for a built-in Backup System.

    And if they'd be able to even let us do incremential and full backups at SPECIFIC intervals, that's just awesome.

    I'm not asking for a full-blown FTP service that allows us to store backups online or anything.
     
  14. Offline

    EvilSeph

    Backups and other intensive/important operations like it should be done separate from the Minecraft server and Bukkit process to ensure stability and integrity are not affected.
     
    root likes this.
  15. It should not be a problem running it on the same server, as long as the process or thread that does it runs at a lower priority.

    I have just finished creating an incremental backup routine for my server wrapper.
    It checks when files were last modified, and only takes the ones that were since last backup.

    It is written in C#, but I'm restricting myself to only functionality that's compatible with Mono, so it should be platform independent through that.
     
  16. Offline

    EvilSeph

    Let me clarify: I do not mean that you shouldn't run backups on the same PHYSICAL server but that doing it through Minecraft or Bukkit isn't such a great idea.
     
    root likes this.
  17. Offline

    Nathan C

    Yeh, I agree. Just stick to using simple Cron Jobs.
     
Thread Status:
Not open for further replies.

Share This Page