second avegame for fallback in case of corrupted savegame

Discussion in 'Archived: Plugin Requests' started by Chrisliebaer, Feb 5, 2012.

  1. Offline

    Chrisliebaer

    Now it also happend to me. My server crashed and my savegame was rendered useless. All my chuncks messed up.

    It was just a little homeserver running vailla, but i got an idea. Why there's no plugin which will use two savegames indead of one and rotates beween these. In case of a power failure or some or some other stuff there would be always one correct savegame. I mean. This is a normal mechanism to prevent inconsistent data. Even the Pokemon games makes use of this. Is there a plugin which will exactly do this or maybe someone would like to create one?

    As of now I will never run an vanilla server.
     
  2. Offline

    FarSideX

    The world files are written to continuously as players build, rotating the 'in use' copy would not be practical. I suggest you use one of the many backup solutions available to you.

    I currently use a script that takes backups hourly and keeps them ~1 week. As a bonus they are in a format is WorldEdit compatible. The backup is not a plugin so it does not cause any lag to the server whatsoever.

    Edit: This solution will also work with a vanilla server since it is not a plugin, nor does it depend on any plugin.
     
  3. Offline

    Chrisliebaer

    Yeah, that is what I was intending to do now.

    I've never checked the server source of how map saving works, but the map is gzip compresses, so I don't think the server will acually just to incremental updates.

    I think it will just open a handle to all region files which are currently loaded and triggers an save after some conditions (time, block changes, etc.). If the server is interrupted while this procress the gzip archiv will not be finished and the whole region or chunk (how ever if this are compressed together or not) will be corrupted. If the server would always makes a backup of the gzip archiv before overriding the old one this annoying problem would be solved.

    But maybe you've got more knowledge about the saving progress, so it would be nice if you would correct me :D

    Edit: I know about the possebility of backups scripts or plugins, but this second savegame is so damn easy to implement that I don't understand why it isn't used.

    I think I will take a closer look on how saving works an maybe I will do this. If the Bukkit API allows that.
     

Share This Page