[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

    MadManMarkAu

    I must contest this point. My world files total 511 MB and zipping them brings them down to 350 MB, a total saving of 31%, well worth zipping. But, an option to enable or disable zipping is always appreciated, simply because it adds extra functionality and saves CPU on overloaded servers.
     
  3. Offline

    ValBGaming

    Hey, this is a great plugin, and I haven't run into any issues with it so far, but I would like to make a request.

    Would it be possible to make a customizable broadcast message that the server displays when a backup is made?

    For example something like "[Server] Creating backup files -- You may experience slight lag for a few seconds." or something. Of course I would hope that the text would be able to be colored, but I would assume that would easily be done with &a, &b, &c, etc.

    This function would be greatly appreciated and hopefully others would agree.

    ~ VBG ~
     
  4. I LOVE YOU AND THIS PLUGIN
     
  5. Offline

    Plague

    Please remove the plus sign from the version tag, it is not allowed.
     
  6. Offline

    Meldanor

    Ok, guys here are some information about the current status:
    I've implemented two features you wanted:
    -Custom broadcast messages
    -World that should not backuped

    I'm working on a option to only store a backup and not zip it and on the fourth feature backuping the world after the last player logged out.
    I will release the next version this day or on the weekend.

    I've done this, sorry for the mistake.

    So far
    so Mel
     
  7. Offline

    Maddin

    I don't know why, but it does not backup... I use craftbukkit build 677 and here's my config file:


    Code:
    // Given in minutes
    BackupIntervall=30
    //When the maximum is hit, the oldest backup will deleted
    MaximumBackups=10
    // Only operator can run manuel backups
    OnlyOps=true
    // Only backup when player are on the server
    BackupOnlyWithPlayer=false
    
    The backup should be saved in /backups/custom, right?
     
  8. Offline

    Kapoff

    Your plugin save my server today.
    World files was corrupted after power cut. I unzip the last backup and all restart well
    Thank you man.
     
  9. Offline

    Juze

    I'm not sure if it's this plugin, but everytime it backups, there's a timeout on the server. My world is 850MB big. Maybe multithread this plugin?
     
  10. Offline

    overlordror

    Awesome! Thanks for the custom broadcast messages. This is something I've been wanting for awhile now.
     
  11. Offline

    MinecraftHead

    Same thing happens to me, latest craftbukkit, General, Help, HeroicDeath,mcMMO,MinecartMania,MyHome,Permissions,SimpleCensor,Vanish,WorldEdit,WorldGuard,xrayDetector,FoundDiamonds
    When the backup starts.
    Everyone gets kicked off the server timed out.
    Javax64 has even hung one attempt.
    World size: 730mb
    Thanks!
    MH
     
  12. Offline

    spunkiie

    your fuckin' lame plugin did not work and ruined my server.

    Thank you very much.
     
  13. Offline

    Meldanor

    I'm very sorry for that, but why can this ruin your server?

    I've uploaded the version 1.4 , which implements the followning features:
    • 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
     
  14. Offline

    Delois

    Thank you for the update! Works much better now and I don't have 100 'ArchiveWorld' saved now.

    EDIT: Your plugin helped save my server once too :3
    EDIT2: Just thought of one minor improvement. Since we can change the message now, how about the ability to add color to the message? May help from message being missed.
     
  15. Offline

    xGhOsTkiLLeRx

    Hey found a little, little bug:

    Console:

    Code:
    2011-04-16 18:27:26 [INFO] [BACKUP] Zipping backup is disabled!
    config:

    Code:
    // Whether it should zip the backup or just store it
    
    ZipBackup is enabled, but console says it's disabled!
    
    (The backups are zipped, so only a "layout" bug)

    Greets
     
  16. Offline

    spunkiie

    The plugin just made 3 backups normally but then stoped without warning/notice. Then, 10 hours later my map corrupted, and I had to told 60+ players that they lose all they past work due to a backup plugin bug.

    Sorry if I sound rude, but i'm very disappointed :(

     
  17. Offline

    xGhOsTkiLLeRx

    Had the bug with 3 backups in 3 minutes of each world, too!
     
  18. Offline

    Meldanor

    What do you mean with 3 backups in 3 minutes of each world? Please give me some details.

    Please give me some more details, too.

    Are there any information in the log?
     
  19. Offline

    xGhOsTkiLLeRx

    Now, it's working correctly.
    Maybe it has to do with the last backup after the last player leaves?

    I've got 3 worlds.
    So my 3 worlds got backup-ed.
    But after a minute it seemed, that the plugin was going to do antoher backup.
    And a minute later again.

    (So I had 9, instead of 3 .zip
    But could be a mistake by me!)

    And still:

    the layout bug ;)

    Greets
     
  20. Offline

    spunkiie

    Nothing in the log, it seens whenever you do a /reload, the plugin doesn't work anymore.

    Suggestion: make a /last command to show when the last backup was done.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 13, 2016
  21. Offline

    lycano

    Bug Report - Null Info Message

    Typed at console; Backup not created
    Code:
    >backup
    16:19:42 [INFO] null
    16:19:42 [INFO] Forcing save..
    16:19:42 [INFO] ConsoleCommandSender: Forcing save..
    16:19:42 [INFO] Saving chunks
    16:19:42 [INFO] Save complete.
    16:19:42 [INFO] ConsoleCommandSender: Save complete.
    16:19:42 [INFO] Disabling level saving..
    16:19:42 [INFO] ConsoleCommandSender: Disabling level saving..
    16:19:42 [SEVERE] java.lang.NullPointerException
    16:19:42 [SEVERE]       at backup.BackupTask.backup(BackupTask.java:97)
    16:19:42 [SEVERE]       at backup.BackupTask.run(BackupTask.java:71)
    16:19:42 [SEVERE]       at org.bukkit.craftbukkit.scheduler.CraftWorker.run(CraftWorker.java:33)
    16:19:42 [SEVERE]       at java.lang.Thread.run(Thread.java:662)
    
    Edit: I didnt updated my config file to the new one. Maybe adding a migration method would be nice ^^

    Eidt2: Parameter ZIPBackup=true is currently somewhat misleading? It outputs "[BACKUP] Zipping backup is disabled!" if set to true oO
     
  22. Offline

    EnzoFX

    ^^ I am getting the same bug.

    Using the latest plugin version, just updated yesterday, and today while I was on the server, I disconnected, server restarted on schedule, and when I rejoined afterwards, there was some lost work on the world, could this be due to it disabling level saving when attempting to do a backup? It was rather strange, It seemed to have my last inventory correct, but I was now above ground instead of down in the mine where I had last disconnected. Though again, the mine was not as I had left it last.

    Also, earlier in the day, I also tried doing a manual backup and it didn't do anything. I went in to the backups directory and noticed there was a backup that wasn't zipped... hmm.

    Edit: Will try updating the config file, see if that solves any of the problems.

    Edit: With the new config, it did do a manual backup now just fine. Though I hope it doesn't trip up again, the server is setup to restart every ~6Hrs using the RemoteToolKit plugin and everything has been fine until I updated to the last version of backup plugin.
     
  23. Offline

    Maddin

    Melandor please help me:
    I don't know why, but it does not backup... I use craftbukkit build 677 and here's my config file:


    Code:
    // Given in minutes
    BackupIntervall=30
    //When the maximum is hit, the oldest backup will deleted
    MaximumBackups=10
    // Only operator can run manuel backups
    OnlyOps=true
    // Only backup when player are on the server
    BackupOnlyWithPlayer=false
    
    The backup should be saved in /backups/custom, right?
     
  24. Offline

    Meldanor

    I'm sorry, I forget to say, that you need to remove your old config.ini file, so the new one is created.
    I'm going to work on a update method for the config.ini

     
  25. Offline

    TOAST7312

    Getting this error whenever it tries to back up something.

    Code:
    20:36:51 [INFO] null
    20:36:51 [INFO] Forcing save..
    20:36:51 [INFO] ConsoleCommandSender: Forcing save..
    20:36:51 [INFO] Saving chunks
    20:36:51 [INFO] Save complete.
    20:36:51 [INFO] ConsoleCommandSender: Save complete.
    20:36:51 [INFO] Disabling level saving..
    20:36:51 [INFO] ConsoleCommandSender: Disabling level saving..
    20:36:51 [SEVERE] java.lang.NullPointerException
    20:36:51 [SEVERE]       at backup.BackupTask.backup(BackupTask.java:97)
    20:36:51 [SEVERE]       at backup.BackupTask.run(BackupTask.java:71)
    20:36:51 [SEVERE]       at org.bukkit.craftbukkit.scheduler.CraftWorker.run(Craf
    tWorker.java:33)
    20:36:51 [SEVERE]       at java.lang.Thread.run(Unknown Source)
     
  26. Offline

    Narmotur

    I was getting that as well, an earlier post mentioned it was because the config file was outdated. Had the plugin make a new one and everything is back to working!
     
  27. Offline

    godsyn

    Code:
    $ cat ./plugins/Backup/config.ini
    #Given in minutes
    BackupIntervall=240
    #When the maximum is hit, the oldest backup will deleted
    MaximumBackups=20160
    #Only operator can run manuel backups
    OnlyOps=true
    #Only backup when player are on the server
    BackupOnlyWithPlayer=true
    #Broadcast message when starting a backup
    MessageStartBackup=Starting backup
    #Broadcast message when completed a backup
    MessageFinishBackup=Finished backup
    #The names of worlds that shouldn't backuped by the server, seperate them by
    # a semicolon
    # Example : World1;World2;Nether
    DontBackupWorlds=
    #Whether it should zip the backup or just store it
    ZIPBackup=true
    
    Console:
    Code:
    06:23:03 [INFO] Backup v1.4 was sucessfully loaded!
    ...
    Code:
    >backup
    06:24:16 [INFO] Starting backup
    06:24:16 [INFO] Forcing save..
    06:24:16 [INFO] ConsoleCommandSender: Forcing save..
    06:24:16 [INFO] Saving chunks
    06:24:16 [INFO] Save complete.
    06:24:16 [INFO] ConsoleCommandSender: Save complete.
    06:24:16 [INFO] Disabling level saving..
    06:24:16 [INFO] ConsoleCommandSender: Disabling level saving..
    06:24:16 [INFO] [BACKUP] Zipping backup is disabled!
    06:24:36 [INFO] Enabling level saving..
    06:24:36 [INFO] ConsoleCommandSender: Enabling level saving..
    06:24:36 [INFO] Finished backup
    While the console states that zipping backup is disabled, it still saves the world as a zip (as intended by the config).
    Code:
    $ ls ./backups/world*18042011*
    worldart18042011-062428.zip     worldold18042011-062429.zip  worldpvp18042011-062427.zip
    worldnether18042011-062426.zip  worldpve18042011-062417.zip
     
  28. Offline

    lycano

    @godsyn: Actually there is a pull request on the road on github. Noticed that some days ago and fixed it. This message is incorrectly triggered on ZIPBackup=true. But this will not affect the backup procedure as the zip-file will be created only on ZIPBackup=true.

    Btw if you can enlighten me what this custom folder does inside the backup folder i would apreciate it 0) ( Didn't reviewed the complete code cause of missing formating, and i wouldn't resist to correct that ;) )
     
  29. Offline

    Meldanor

    I've uploaded the version 1.4a. It only fixes the problem with
    Code:
    [BACKUP] Zipping backup is disabled!
    @lycano:
    Thanks for giving me a diff for a quicker solution ;)
    The custom dir stores all manuel backups, when a player uses the command /backup or when you use the command on the console, the created backup is stored in the /custom dir.

    I will start working on Version 1.5 the next days, which will include (maybe) the followning features:
    -Modifing the backupnames(thanks to xfxian for a solution)
    -A config update option...
    -A option to store all backuped worlds in one zip instead of many backups.
    -Maybe adding a command to see when the last backup is made ( thanks for spunkiie for the suggestion)
     
  30. Offline

    lycano

    @Meldanor: Hehe, it was odd to see this single line hanging around alone without an inverter and seeing this message directly underneath ;)

    Thanks for the explanation. This has come to my mind but i wasn't certain =) Looking forward to see your furture updates ^^
     
  31. Offline

    godsyn

    Suggestions:
    Code:
    System.out.println("[BACKUP] The server skip backup, because no player are online!");
    change to:
    Code:
    System.out.println("[BACKUP] Scheduled backup was aborted due to lack of players. Next backup attempt in %time left% minutes.")
    ---
    Code:
    System.out.println("[BACKUP] Zipping backup is disabled!");
    change to:
    Code:
    System.out.println("[BACKUP] Backup compression is disabled.");
    ---
    Code:
    System.out.println("[BACKUP] Skip the followning worlds :");
    change to:
    Code:
    System.out.println("[BACKUP] Backup is disabled for the following world(s):");
    ---
    Code:
    System.out.println("Delete old backups");
    change to:

    Code:
    System.out.println("[BACKUP] Removing the following backups due to age: %list of compressed files/directories%");
     

Share This Page