[INACTIVE][ADMN] Backup 1.6 - A simple Backup Plugin [818]

Discussion in 'Inactive/Unsupported Plugins' started by Meldanor, Mar 25, 2011.

  1. Offline


    I've stopped the development of this plugin, becase I lost the motivation. The user 'gamerx93' will continue my work in this thread:


    Backup - A simple Backup Plugin :
    Version : 1.6

    After I've searched for a simple, but powerfull backup plugin, I've tried some backups, but some have bugs, other don't save the world before they zip and so on. So I decided to write my own backup plugin.

    • Automatically backups the server(all worlds) in a Intervall you've decided and zip it.
    • Saves every world running on the server and every player before the backup
    • Supporting Permission
    • Supporting manuel backups (you can use an ingame command or on the console)
    • Storing only a limit of backups that you've configure
    • You can set that only to backup when player are on the server
    • Stores also the plugin folder
    • Formate the date format

    Version 1.6:
    • Added option to control where the backups are getting stored
    • Fixed disabling broadcast messages
    • You can now use also the old save system, which is the same as before 1.5
    • Uses godsny's suggestion for the config file. Thanks !
    • Fixed bug deleting the custom dir when the maximum backup limit is hit!
    • Fixed bug stopping the complete backup if there is one file error!
    • Fixed bug not disabling the automatic backup when you set the BackupIntervall to -1
    Version 1.5:
    • Added property to also backup the plugin folder(is set to true by default)
    • Fixed issue with data corruption by using not thread save methods. Thanks to desmin88 for the hints!
    • All worlds(and when enabled the plugin folder) is stored in ONE ZIP
    • Customize the timestamp by merge a fork of xfxian . Thanks to xfxian!
    • You can now disable enabling the autosave (the command "save-on", not the backup cyclus!) by setting the property to true. It is false by default. Notify, that I will run the command "save-off" before I will start the backup to prevent unwished results!
    • When server is starting, the config.ini is checked now. If you don't have the current config.ini you can see on the console a error. Remove / relocate the config temporary to get the newest one.
    Show Spoiler

    Version 1.4a:
    • Fixed the bug " [Backup] Zipping backup is disabled! "
    Version 1.4:
    • Use ASyncMethod instead of SyncMethod (the lags should be gone)
    • Own broadcast messages ( change the message in you config.ini file)
    • A backup is run when the last player has left the server after the normal backup cyclus.
    • Remove worlds from backup (add the names of the worlds in your config.ini files)
    • Add an option to just store the worlds in dirs or zip them
    • Some minor improvements
    Version 1.3a:
    • You can now run a backup from the console using the command backup
    Version 1.3:
    • Implemented new function to only backup when player are online
    • Use Apache Common IO library instead of code from the internet for a better performance and better stability
    Version 1.2b:
    • Fixed bug with empty dirs
    Version 1.2a:
    • Fixed bug not creating config.ini
    Version 1.2:
    • Implement property so only ops can start manuell backups
    • Updated to recommened build 602
    • Tried to fix the problem with some system by using the system file seperator
    Version 1.1:
    • Added option to give manual backups a name(which will never automatically removed by auto backup)
    Version 1.0:
    • First release

    Just place it in your plugins dir

    Show Spoiler

    After the first start of the plugin it generates a config.ini in "plugins/Backup".
    Here is the current content:

    // --All variables are in minutes--
    // How often show the backup run? (#)
    // Notice: -1 Will disable automatic backups. You have to run the backups now manually!
    // How many backups are retained? If this limit is hit, the oldest backup will be removed. (#)
    // Only allow Ops to preform manual backups? (true/false)
    // Should backups only be preformed when there are players on the server?
    // Notice: When the last player leaves the server, a final backup will be made
    // within the backup cycle. The automatic backup cycle will resume when a player
    // joins. (true/false)
    // Server broadcast message when starting a backup.
    // Notice : Remove the messages(not the property) to disable a broadcast. (text)
    MessageStartBackup=Start backup
    // Server broadcast message when a backup is completed.
    // Notice : Remove the messages(not the property) to disable a broadcast. (text)
    MessageFinishBackup=Finished backup
    // Worlds that should not be archived by the server, seperate them by
    // a semicolon. (directory names)
    // Example : World1;World2;Nether
    // ZIP backups?
    // If enabled, backups will be compressed and stored in a ZIP archive named with
    // the current timestamp.
    // If disabled, the backup will stored in a folder with the timestamp. (true/false)
    // Custom date format string that is appended to every backup.
    // If left empty, the default date format is used.
    // This has to be a Java String.format string, see
    // http://download.oracle.com/javase/1.5.0/docs/api/java/util/Formatter.html#syntax
    // for reference.
    // Example: -%1$tY%1$tm%1$td-%1$tH%1$tM%1$tS (YYYYMMDD-HHMMSS: 20101201-011323) (conforms to ISO 8601)
    // Enables the auto-save function after the backup.
    // Notice: If you set this to false, this plugin will backup your worlds but not save
    // the data from the memory to your hard disc. If the server crashes between
    // backups, all work is lost. Disable if you use another plugin to save the world
    // to disk (EG: autosave). (true/false)
    // Backup plugin directory? (true/false)
    // Location of backups
    // Store all backuped world in one zip? (true/false)
    // If false every worlds backup is saved in one directory named in the format:

    After this just type in your server
    to reload the settings


    /backup starts a manuel Backup of your server. If you don't have permissions, everybody can run this command.
    /backup NAME starts a manuel Backup of your server. This backup is stored in backups/custom

    So far
    So Mel
  2. Offline


    i know that i have also got errors before with "bukkitscheduler", dont know how to type it. my server's depends on this plugin i love it so much but i strongly sugest you to re buld it with the newest build, but since they had to hurry (the bukkit team) they might left some code unfinished, i realy dont know. my servers run allot of plugins and i got a too many files open error too yester day i realy hope my server system aint breaking again ._. that would suck. and all of my cats was locked outside to night i woke up at 3 am and they were going like "Meow? ._." at the door
    haddent had much sleep tonight im kinda going like (Banana Noes!!) but i love your plugin<33

    something i came up with tonight my worlds name is Doom does i find it automaticly?
    Know the problem!! nothing wrong with the plugin! The config File was the problem deleted it and the plugin made a new one works great! now <33333
  3. Offline


    Yes the problem is caused by the old config. I will implement a way to disable the broadcast messages.
    Ben91 likes this.
  4. Offline


    Thanks Meldanor !
    Hope soon :)
  5. Offline


    Please add to config option:
    Because my server always have command 'save-off' and this plugin change it to 'save-on'.
    Save-all is good, but save-on is bad.

    Sorry for my English :)
  6. Offline


    Forcing save..
    [INFO] ConsoleCommandSender: Forcing save..
    [INFO] Saving chunks
    [SEVERE] java.io.IOException: The handle is invalid
    [SEVERE]     at java.io.RandomAccessFile.seek(Native Method)
    [SEVERE]     at net.minecraft.server.RegionFile.a(SourceFile:342)
    [SEVERE]     at net.minecraft.server.RegionFile.a(SourceFile:279)
    [SEVERE]     at net.minecraft.server.ChunkBuffer.close(SourceFile:259)
    [SEVERE]     at java.util.zip.DeflaterOutputStream.close(Unknown Source)
    [SEVERE]     at java.io.FilterOutputStream.close(Unknown Source)
    [SEVERE]     at net.minecraft.server.ChunkRegionLoader.a(SourceFile:64)
    [SEVERE]     at net.minecraft.server.ChunkProviderServer.saveChunk(ChunkProviderServer.java:160)
    [SEVERE]     at net.minecraft.server.ChunkProviderServer.saveChunks(ChunkProviderServer.java:190)
    [SEVERE]     at net.minecraft.server.World.save(World.java:143)
    [SEVERE]     at net.minecraft.server.World.doTick(World.java:1458)
    [SEVERE]     at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:361)
    [SEVERE]     at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:285)
    [SEVERE]     at net.minecraft.server.ThreadServerApplication.run(SourceFile:394)
    [INFO] Save complete.
    [INFO] ConsoleCommandSender: Save complete.
    [INFO] Disabling level saving..
    This is the error I had been getting.

    The [SEVERE] error lines were removed after I deleted the config and restarted the server.

    I'm not sure why this started happening, about 24h after install.
    If it helps, my server structure:
    --proper zip backups of the worlds
    ---edited config
    -misc. server files
    Thanks for the great plugin, should mean I never need to completly restart my server again becouse of a powercut and it's already saved me once.
  7. Offline


    I would like to add, that we lost about 4 days work because of this config exception error. Backups did not happen because of the exception, but what made things worse was that level saving gets disabled then the exceptions happens, but level saving is never enabled again... I would suggest some sort of try..catch..finally here.

    Good work and a much appreciated plugin otherwise.
  8. Offline


    It's possible to add, in addition of DisableBroadCastMessage, the 15minutes player check for each world ? I explain,

    I have a normal world and a nether and 80percents of players always play on normal world, but, each 15minutes, Backup backup (lol) the twice worlds.

    Thanks ! :)
  9. Offline


    What does the number at "MaximumBackups" mean?
    A maximum of 1440 backups?
  10. Offline


    Damn you!
    This works really great! I say to all my MC server owners; Download this one.
    it works really easy! Config everything and done.

    But there is a problem; The server goes laggy a little.
  11. Offline


    Yes, this is the amount of backups that will be stored. Once the maximum has been reached it will start deleting the oldest ones.

    @Meldanor I'm have a problem with my version. As far as I know the config is OK but I have to run manual backups because it doesn't seem to autobackup. Any ideas what could be the problem?
  12. Offline


    Hey I was wondering if someone could post a Backup.jar for 733. I can't use 740 because some plugins I use haven't updated to it and the 740 .jar doesn't work for 733. Thanks :D
  13. Offline


    I'm working on a more general way to solve this.

    I've fixed this in my development build. I'm very sorry, because this musn't happen in a backup plugin.
    Do you want to add special backup timers for each worlds?
    So that your normal world is backuped every 15 minutes, the nether only every 60 minutes?

    I can not solve this problems, because this is not the software problem, but the hardware problem. Your server needs to long to copy the worlds and zip them. After this the temp dirs must deleted by the server. When the world is bigger, the server needs of course longer to do this operations.

    Mmmm...I'm running the plugin of course on my own server, but I've never realized this problem. I will take a look at it and try to fix it.
    Are you sure that the version doesn't work for 733? The plugin is mostyl indepentent from newer versions of CraftBukkit.

    @The others:
    I've implemented the version check in the config file. I will add other features and fix the bugs in a few days.
  14. Offline


    It will not backup automatically but only manually.
  15. Offline


    In a first time i want to backup the twice worlds every 15minutes.
    For exemple if 2 players are on normal world, pasts 15minutes, the normal and the Nether will be backups !
    Nevertheless, nobody is in the Nether.
    If nobody is in Nether, dont backup Nether.

    Thanks ! :)

    Ps : Sorry for my bad english.
  16. Offline


    Meldanor, can you implement custom names for backup files?
    Something like this:

    It will be more informative, because names like DMMYYYY-HHMMSS hard to understand when you have over 20 backups. And sorting don't work well in any filemanager (Midnight Commander).

    Thank you.
  17. Offline


    Fine plugin :D

    The "MaximumBackups" is a bit badly presented so many people don't understand immediatly that's talk about "numbers" of backup
    I think because you put a too many high number into your exemple file ^^

    One suggestion @Meldanor
    Can you add a way to choose which folders will be saved into the backup ?
    Personally I wish to backup my "plugins" folder with the world one ...
  18. Offline


    OMG, I got a fatal error, and Losed my worlds and stats. (from mcc plugin)
    The worlds I restored with Backup, but the stats I losed them forever :((((

    Add please an option in config file to backup the plugins you want.
  19. Offline


    Yep a plugin backup would be nice. Maybe add an API where the plugin is telling your plugin which files have to be saved. And it would be nice, if you could add a directory to define where the backups are saved.

    Meldanor likes this.
  20. Offline

    David Collantes

    Running latest Bukkit, latest Essentials plugins (backup disable in it) and A Simple Backup, nothing else. It seems it isn't acknowledging the "BackupOnlyWithPlayer=true". Can anyone else confirm?
  21. Offline


    What is latest? I'm running Craftbukkit 740 with essentials 2.2.6 (and some other plugins) and it is making only one backup after 15 minutes if all players left.

  22. @Meldanor Does this backup all your current plugin setups too?
  23. Offline

    David Collantes

    Interesting. It seems it is delayed somehow. I got a backup for 5 after the hour (I was online, only user for now). Logged off around 10 after the hour, but got another backup 22 after the hour; it then stopped (no users online).

    The default to keep old backups, 1440, is it minutes, as in a 24 hours period?
  24. Offline


    No, but i will implement an option to backup the plugin settings.

    It is now in the development build, view https://github.com/Meldanor/Backup/pull/2 for further information. A big thanks to xfxian!

    I've tested it and everything is ok, can you post your config file? What plugin are you running on your server except mines?
    That would be interesting but I don't have the knowledge at the moment to do this^^
    I will think about it, but this will not be in version 1.5 , because my code is growing and growing and this would be a feature which will increase the code. Maybe in version 1.6 or another version, can't promise you.
  25. Offline


    Hmmm, an easy approach would be to create an interface:
    public interface Backupable {
        File[] getFiles();
    And on every backup you iterate through all plugins and check if the plugin is implementing the interface and is enabled. If so, simply execute the method “getFiles()” (or something like that) and add the files listed in the array.

    You also could use a List instead of an array. And there could be a problem, if there is a file is locked.

  26. Offline


    You're very welcome Meldanor, thanks for creating and maintaining this fine project in the first place! :)
  27. Offline


    Thanks for this easy solution, I'm really ashame of this, because I didn't think longly enough to find this simple solution^^

    Will implement this in a specail release.
  28. Offline


    Is this plugin good for RAMDISK worlds?
  29. Offline


    How I can build it? Never built for Java (only C/C++)
  30. Offline


    Is it possible to implement a custom save path?
    I'm running my server on a ramdisk and would like to save it to another disk/location.
    halofreak506 likes this.
  31. Offline


    Is this multi-threaded? So like it runs in the background? Also where are the backups stored?

Share This Page