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

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

  1. Offline

    Meldanor

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

    http://forums.bukkit.org/threads/admn-backup-v1-8-3-a-simple-backup-plugin-1392.39927/

    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.

    Features:
    • 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
    Download:
    Source
    Plugin

    Changelog:
    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

    Install
    Just place it in your plugins dir

    Configuration
    Show Spoiler

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

    Version=1.6
    // --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!
    BackupIntervall=15
    // How many backups are retained? If this limit is hit, the oldest backup will be removed. (#)
    MaximumBackups=96
    // Only allow Ops to preform manual backups? (true/false)
    OnlyOps=true
    // 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)
    BackupOnlyWithPlayer=true
    // 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
    DontBackupWorlds=
    // 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)
    ZIPBackup=true
    // 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)
    CustomDateFormat=%1$td%1$tm%1$tY-%1$tH%1$tM%1$tS
    // 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)
    EnableAutoSave=true
    // Backup plugin directory? (true/false)
    BackupPluginDIR=true
    // Location of backups
    BackupDir=backups
    // Store all backuped world in one zip? (true/false)
    // If false every worlds backup is saved in one directory named in the format:
    // WORLDNAME_TIMESTAMP
    SummarizeBackupContent=true

    After this just type in your server
    /reload
    to reload the settings


    Permissions
    backup.canbackup

    Commands
    /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

    tekac

    @Meldanor looks like the config.ini file is not generating. So its spazzing an error "No config found"
     
  3. Offline

    derchris

    I have the same problem with Nether worlds not being backed up:

    Code:
    23:47:09 [INFO] java.io.IOException: Error copying the Directory!
    nether
    /home/minecraft/die-revolution-1.4
    backups/nether
    23:47:09 [INFO]         at io.DiscManagement.copyDirectory(DiscManagement.java:63)
    23:47:09 [INFO]         at backup.BackupTask.backup(BackupTask.java:84)
    23:47:09 [INFO]         at backup.BackupTask.run(BackupTask.java:57)
    23:47:09 [INFO]         at org.bukkit.craftbukkit.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:122)
    23:47:09 [INFO]         at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:356)
    23:47:09 [INFO]         at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:283)
    23:47:09 [INFO]         at net.minecraft.server.ThreadServerApplication.run(SourceFile:375)
    
     
  4. Offline

    iTimmeh

    Manual back up command won't work for me on 617 build.
     
  5. Offline

    ioScream

    plus update this :))))

    Also, does this do a backup when you type "stop" in the console? If so, can you make that toggle-able behavior?
     
  6. Offline

    Raspberry

    what a memory leak on this thing... crashes the whole server -- same issue as Matimba... won't create the config... blows the server up without it :)
     
  7. Offline

    ioScream

    I can confirm that this does not create a config file.. while, I believe, the standard behavior for plugins is to create a missing folder/config file.
     
  8. Offline

    Funstar

    Hey, just wanted to let you know, that I installed Backup yesterday for the first time, latest release for latest Bukkit. For me, it created the subfolder, but not the config.ini. This ended in pushing my cpu load to 100%. Creating the file manually, the problem got fixed.

    But another question: maximumbackups, is this for the maximum age or for the maximum count of backups? Cause one single backup does 64 mbyte, I am not sure if 1440 is the value I want if is the maximum count. ;)
     
  9. Offline

    Meldanor

    I fixed the bug with the config file, sry for this :/
    New version is online

    I don't have any idea, why nether worlds are not backuped , will look at this.

    Also updated to version 617
     
  10. Hey Great plugin :)

    I know you heard this alot before but i get this error with the latest version of your plugin:

    Code:
    12:16:53 [INFO] Start backup
    12:16:53 [INFO] Disabling level saving..
    12:16:53 [INFO] ConsoleCommandSender: Disabling level saving..
    12:17:10 [INFO] java.io.IOException: Error copying the Directory!
    Survival
    D:\Craftbukkit
    backups\Survival
    12:17:10 [INFO]         at io.DiscManagement.copyDirectory(DiscManagement.java:63)
    12:17:10 [INFO]         at backup.BackupTask.backup(BackupTask.java:85)
    12:17:10 [INFO]         at backup.BackupTask.run(BackupTask.java:57)
    12:17:10 [INFO]         at org.bukkit.craftbukkit.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:122)
    12:17:10 [INFO]         at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:356)
    12:17:10 [INFO]         at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:283)
    12:17:10 [INFO]         at net.minecraft.server.ThreadServerApplication.run(SourceFile:375)
    12:17:13 [INFO] Enabling level saving..
    12:17:13 [INFO] ConsoleCommandSender: Enabling level saving..
    12:17:13 [INFO] Finished backup

    But i will make a zipfile with the world in it though. (Don't know about corruption)
    Yep its corrupted 8 kb for the world x-)

    Keep up the great work!
     
  11. Offline

    joshgriff5

    One question. when it backups it gives me a backup folder and inside of it is the saves. They are winrar files. How do i load a recent backup?
     
  12. Offline

    Meldanor

    Just unzip them. I don't have any solution for a plugin side handling for this, because I've to load the backup, when the server is down, but then the plugin doesn't work.

    At the ones with problems backuping:
    Please descripe the structure of your server dir. Where are the worlds saved?
    And when it is possible, can you send me the server dir, so I can check this on my system? (ofc without any unnecessary information like personal informations , who is an op, who is on the white list and I don't need the complete plugin dir).
     
  13. Offline

    unachemaxwell

    I am getting same errors as above people.

    I will send you a link to my server directory for you to check.. Ill send a link to an upload in a PM.
     
  14. Well mine server dir is (windows server 2008)
    D:\Craftbukkit\XBWBuild and
    D:\Craftbukkit\Survival

    The XBWBuild backup is going fine only the second world (Survival) won't backup properly.
     
  15. Offline

    bwoodwar

    I was wondering the same thing. A high value like 1440 works if its maximum age of a backup. However, if its maximum number of backups you want that to be 96 for a 15 minute backup interval over 24 hours.
     
  16. Offline

    LucidLethargy

    So I love this plugin, and so far it's worth not having to deal with simpleserver to endure the following, but regardless here's the issue I'm having: Every time it backs up my server it freezes up absolutely everything and sometimes kicks people. This only locks things up for about 45-60 seconds, but it's still pretty harsh. If possible, a solution would be amazing (I know for a fact simpleserver's backups lagged as well, but never froze things up at this level.)

    I am using CB: 617 and Backup 1.2a
     
  17. Offline

    vander_fr

    Nice plugin !

    But it's need to say anything during the backup to explain why player can not modify blocks .
    a var in the .ini like :

    saywhendisabled edit :
    say whenreenablededit :
     
  18. Offline

    ksevelyar

    backups - FreeCommander XE_2011-04-05_02-17-42.png
    Code:
    01:08:19 [INFO] Start backup
    01:08:19 [INFO] Disabling level saving..
    01:08:19 [INFO] ConsoleCommandSender: Disabling level saving..
    01:08:43 [INFO] java.io.IOException: Error copying the Directory!
    nether
    /home/ksevelyar/dobroservers/minecraft
    backups/nether
    01:08:44 [INFO]         at io.DiscManagement.copyDirectory(DiscManagement.java:63)
    01:08:44 [INFO]         at backup.BackupTask.backup(BackupTask.java:85)
    01:08:44 [INFO]         at backup.BackupTask.run(BackupTask.java:57)
    01:08:44 [INFO]         at org.bukkit.craftbukkit.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:122)
    01:08:44 [INFO]         at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:356)
    01:08:44 [INFO]         at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:283)
    01:08:44 [INFO]         at net.minecraft.server.ThreadServerApplication.run(SourceFile:375)
    01:08:44 [INFO] Enabling level saving..
    01:08:44 [INFO] ConsoleCommandSender: Enabling level saving..
    01:08:44 [INFO] Finished backup
    01:08:44 [INFO] Delete old backups
     
  19. Offline

    Jack Bartlett

    I'm having issues :(
    I kept the defualt config but changed it to 2800 saves before delete, and it only saves the level.dat which is 1kb.
    I'm not sure whats wrong with it, but I need it back up ASAP
     
  20. Offline

    Kapoff

    Thank you for this simple plugin :
    • No dependency
    • Open source
    • Functionnal !
    Keep it up
     
  21. Offline

    EnzoFX

    I have yet to have to revert to an older save, but thank you for this! I too would like to request the disable on idle feature, no point in doing many backups when no one is on the server right? hehe.
     
  22. Offline

    Zirind

    10:46:28 [INFO] Start backup
    10:46:28 [INFO] Disabling level saving..
    10:46:28 [INFO] ConsoleCommandSender: Disabling level saving..
    10:46:28 [INFO] java.io.IOException: Error copying the Directory!
    world
    /home/junk/Desktop
    backups/world
    10:46:28 [INFO] at io.DiscManagement.copyDirectory(DiscManagement.java:63)
    10:46:28 [INFO] at backup.BackupTask.backup(BackupTask.java:85)
    10:46:28 [INFO] at backup.BackupTask.run(BackupTask.java:57)
    10:46:28 [INFO] at org.bukkit.craftbukkit.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:122)
    10:46:28 [INFO] at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:356)
    10:46:28 [INFO] at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:283)
    10:46:28 [INFO] at net.minecraft.server.ThreadServerApplication.run(SourceFile:375)
    10:46:28 [INFO] java.util.zip.ZipException: ZIP file must have at least one entry
    10:46:28 [INFO] at java.util.zip.ZipOutputStream.finish(ZipOutputStream.java:321)
    10:46:28 [INFO] at java.util.zip.DeflaterOutputStream.close(DeflaterOutputStream.java:163)
    10:46:28 [INFO] at java.util.zip.ZipOutputStream.close(ZipOutputStream.java:338)
    10:46:28 [INFO] at io.DiscManagement.zipDirectory(DiscManagement.java:191)
    10:46:28 [INFO] at backup.BackupTask.backup(BackupTask.java:95)
    10:46:28 [INFO] at backup.BackupTask.run(BackupTask.java:57)
    10:46:28 [INFO] at org.bukkit.craftbukkit.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:122)
    10:46:28 [INFO] at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:356)
    10:46:28 [INFO] at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:283)
    10:46:28 [INFO] at net.minecraft.server.ThreadServerApplication.run(SourceFile:375)
    10:46:28 [INFO] Enabling level saving..
    10:46:28 [INFO] ConsoleCommandSender: Enabling level saving..
    10:46:28 [INFO] Finished backup

    I'm sure you've seen this already, but hey, more error codes never hurt anything right...wait..:) Also, I'd like to point out that all the .zips in the backup folder are empty.

    I'm running Ubuntu by the way, since it might matter in the file creation and such.
     
  23. Offline

    nicatronTg

    So, what gives?
    [​IMG]
     
  24. So?? Got an status update??

    @nicatronTg
    Thats only at your computer....
     
  25. Offline

    joe9439

    Thanks for the great program! It's been running great on my server and I'm running craftbukkit 619 right now. I have it set to backup every hour. It saved me today. My server crashed today and my world files got corrupted. I just moved to backup to the world file and unzipped it and everything worked right away. Freaking awesome!!
     
  26. Offline

    Roujo

    Yay! A backup plugin! =D

    I've found that my first world backups perfectly AFAIK, but that the others don't. It's not just the Nether ones either. I have three worlds. Creative is my main one, and the backups are fine. The others are named Nether and Survival, and the backup files only contain the level.dat and level.dat_old files. I hope this helps troubleshoot the problem.

    I too came from SimpleServer, and it had a feature I really liked - I don't know if you'd know how to implement it, but I'll shoot anyway. =P SimpleServer only backed up your files if a player was on the server. This saved a lot of space on less frequented servers like mine, sinced we'd only get backups that were actually meaningful. =) Mind you, maybe you already do this and my server was more busy than usual, too. =P

    I just noticed that you've put up the source for you plugin. (^_^) I'll look into it, and I'll get back to you on the multiworld issue and the feature request I made. Thanks again for the plugin!
     
  27. Offline

    Meldanor

    Ok, I'm sry for waiting for news, but I'm busy at the moment. At the weekend I will try everything to fix the bugs and I will implement a property you allow to controll whether it saves when players on the server. this is very simple.
    The lag issue, I have a idea.
    To the "I can't backup":
    It is caused by a problem at coping the world into a temp folder. Maybe the file acces is denied when the server is running. But why does this work with normal worlds? I don't know, but I will use this weekend at first for sleeping and than for bug fixing, I promise you!
    @nicatronTg
    I can promise you, that this is a wrong alarm. I using a clean PC for compiling and uploading this.
     
  28. Offline

    Clancy Dawson

    Freakin' awesome man. My world stuffed up today so I had to go back to a 2 day old manual backup which was missing lots of work. Now I don't have to worry as much ^_^ TYTY
     
  29. Offline

    Maddin

    Where does it save it?
    If there is a specified place, please add, that i can choose where to save it (config file)

    ~/Maddin/
     
  30. Offline

    Thresher

    Thanks for the plugin, Meldanor! My PC lost power earlier this week and my world files inadvertently got corrupted, but this mod saved the day!

    Also, the backup errors a few people have mentioned with multi-world backups are because of empty directories (usually the "players" directory).

    If you're getting "java.io.IOException: Error copying the Directory!" errors, ensure all of the directories in the world folder have at least one file in them. In my case I resolved the errors by creating a blank text file in netherWorld/players/.

    Hope this helps.

    Thanks,
    Thresher
     
    Silverlink likes this.
  31. Offline

    adam111316

    Ah thanks mate, works a charm!
     

Share This Page