[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

    Ratchet

    does the backup timer not persist through restarts?
     
  3. Offline

    EnzoFX

    Is there a recommended world manager plugin? I'm treading on unknown waters here lol

    I created a world manually, by temporarily renaming the default "world" folder so that it created a new one. I am venturing on world management, but I had the feeling this backup plugin would pickup both folders, seeing as they are named "world" and "world_two" and then back both up. It didn't.

    Edit: Looks like I need multiverse plugin. Judging from previous posts here, I believe it works just fine with this backup plugin.
     
  4. Offline

    melonball12

    Please add Multi-Verse support!
     
  5. Offline

    xZise

    rofl??
    Any other wishes which already implemented?

    Fabian
     
  6. Offline

    HadrienM

    Wow ! I used it, and i saw this (configured to backup limit : 3):

    The plugin create a folder with all worlds and plugin directory in.
    Then, the plugin compress this folder in a .zip

    That's ok, but sometime after, i see this message box : "Warning : Available space storage in C: is 1,66Mo" (something like that in French)

    Then i stop the server and i see 3 .zip files in the backup folder and all the backup folders created before being "zipped".

    So, the entire backup folder size was : 15,6GB (Wow !) I deleted all the backup folders and i kept the .zip files, then i've desactivated the plugin and i've restarted my server.

    If you understood (i'm French :p), is this normal ?
     
  7. Offline

    xZise

    Depends on the version. In versions prior to 1.6 it was possible, that the coping process was halted, because a file was changed or something similar. Since 1.6 (imho) Backup now ignores all files which couldn't be copied.

    The problem was, because it get halted, it doesn't zip it anymore. But afaik, it should delete the directories anyway.

    Fabian
     
  8. Offline

    Liquid_Ice

    Can you add worldedit support? And the ability to disable the save before backup message (it kind of clutters chat). I like to keep the backup message though. (starting backup, backup complete).
     
  9. Offline

    Toxik

    This is my first post here, just been lurking a lot, so hello everyone.
    I really love this plugin, it works great for me with CB 860.
    But I was planning to upgrade to CB 928, has anyone already tested this?
     
  10. Offline

    xZise

    It seems to working on my server.

    And is it somehow possible to disable/hide the messages about “ConsoleCommandSender”?

    Fabian
     
  11. Offline

    Leemur

    how I can to set the message "staring backup" with other color?
    I tryed the simbol §, in windows it's all alright, but in linux doesn't work.
     
  12. Offline

    killraven

    Looking for validation this plug-in works with 928. If so please update the topic to indicate it is supported.
     
  13. Offline

    RugRats

    It even works in 935 :D
     
  14. Offline

    xlilcasper

    Is it possible to have all my worlds backed up to different zip files? I use world guards //restore command to restore pieces from backups. This works with zip files but not if all the worlds are zipped together. What I would like is each world saved to it's own zip file. Each file should be titled something along the lines of <date>-<time>-<world>.zip or something similar. Can this plugin do that? I see that it does zip, and SummarizeBackupContent=false says it will put it into its own folder but will these two work together to give multiple zips?
     
  15. Offline

    dark1256

    i got this error:
    Code:
    2011-06-28 17:42:51 [INFO] [BACKUP] An error occurs while creating a temporary copy of world multiplayer. Maybe the complete world isn' backuped, please take a look at it!
    2011-06-28 17:42:51 [INFO] java.io.IOException: Map failed
    2011-06-28 17:42:51 [INFO]     at sun.nio.ch.FileChannelImpl.map(FileChannelImpl.java:803)
    2011-06-28 17:42:51 [INFO]     at sun.nio.ch.FileChannelImpl.transferFromFileChannel(FileChannelImpl.java:578)
    2011-06-28 17:42:51 [INFO]     at sun.nio.ch.FileChannelImpl.transferFrom(FileChannelImpl.java:641)
    2011-06-28 17:42:51 [INFO]     at io.FileUtils.doCopyFile(FileUtils.java:299)
    2011-06-28 17:42:51 [INFO]     at io.FileUtils.doCopyDirectory(FileUtils.java:265)
    2011-06-28 17:42:51 [INFO]     at io.FileUtils.doCopyDirectory(FileUtils.java:263)
    2011-06-28 17:42:51 [INFO]     at io.FileUtils.copyDirectory(FileUtils.java:231)
    2011-06-28 17:42:51 [INFO]     at io.FileUtils.copyDirectory(FileUtils.java:157)
    2011-06-28 17:42:51 [INFO]     at io.FileUtils.copyDirectory(FileUtils.java:126)
    2011-06-28 17:42:51 [INFO]     at threading.BackupTask.backup(BackupTask.java:77)
    2011-06-28 17:42:51 [INFO]     at threading.BackupTask.run(BackupTask.java:57)
    2011-06-28 17:42:51 [INFO]     at org.bukkit.craftbukkit.scheduler.CraftWorker.run(CraftWorker.java:34)
    2011-06-28 17:42:51 [INFO]     at java.lang.Thread.run(Thread.java:679)
    2011-06-28 17:42:51 [INFO] Caused by: java.lang.OutOfMemoryError: Map failed
    2011-06-28 17:42:51 [INFO]     at sun.nio.ch.FileChannelImpl.map0(Native Method)
    2011-06-28 17:42:51 [INFO]     at sun.nio.ch.FileChannelImpl.map(FileChannelImpl.java:800)
    2011-06-28 17:42:51 [INFO]     ... 12 more
    2011-06-28 17:42:51 [INFO] java.io.IOException: Map failed
    2011-06-28 17:42:51 [INFO]     at sun.nio.ch.FileChannelImpl.map(FileChannelImpl.java:803)
    2011-06-28 17:42:51 [INFO]     at sun.nio.ch.FileChannelImpl.transferFromFileChannel(FileChannelImpl.java:578)
    2011-06-28 17:42:51 [INFO]     at sun.nio.ch.FileChannelImpl.transferFrom(FileChannelImpl.java:641)
    2011-06-28 17:42:51 [INFO]     at io.FileUtils.doCopyFile(FileUtils.java:299)
    2011-06-28 17:42:51 [INFO]     at io.FileUtils.doCopyDirectory(FileUtils.java:265)
    2011-06-28 17:42:51 [INFO]     at io.FileUtils.doCopyDirectory(FileUtils.java:263)
    2011-06-28 17:42:51 [INFO]     at io.FileUtils.copyDirectory(FileUtils.java:231)
    2011-06-28 17:42:51 [INFO]     at io.FileUtils.copyDirectory(FileUtils.java:157)
    2011-06-28 17:42:51 [INFO]     at io.FileUtils.copyDirectory(FileUtils.java:126)
    2011-06-28 17:42:51 [INFO]     at threading.BackupTask.backup(BackupTask.java:86)
    2011-06-28 17:42:51 [INFO]     at threading.BackupTask.run(BackupTask.java:57)
    2011-06-28 17:42:51 [INFO]     at org.bukkit.craftbukkit.scheduler.CraftWorker.run(CraftWorker.java:34)
    2011-06-28 17:42:51 [INFO]     at java.lang.Thread.run(Thread.java:679)
    2011-06-28 17:42:51 [INFO] Caused by: java.lang.OutOfMemoryError: Map failed
    2011-06-28 17:42:51 [INFO]     at sun.nio.ch.FileChannelImpl.map0(Native Method)
    2011-06-28 17:42:51 [INFO]     at sun.nio.ch.FileChannelImpl.map(FileChannelImpl.java:800)
    2011-06-28 17:42:51 [INFO]     ... 12 more
     
  16. Offline

    shell64

    i get this on b953:
    07:34:02 [INFOS] ConsoleCommandSender: Save complete.
    07:34:02 [INFOS] Disabling level saving..
    07:34:02 [INFOS] ConsoleCommandSender: Disabling level saving..
    07:34:02 [INFOS] [BACKUP] Backup compression is disabled.
    07:34:03 [INFOS] java.lang.ArrayIndexOutOfBoundsException: 13
    07:34:03 [INFOS] at threading.BackupTask.deleteOldBackups(BackupTask.java:155)
    07:34:03 [INFOS] at threading.BackupTask.backup(BackupTask.java:116)
    07:34:03 [INFOS] at threading.BackupTask.run(BackupTask.java:57)
    07:34:03 [INFOS] at org.bukkit.craftbukkit.scheduler.CraftWorker.run(CraftWorker.java:34)
    07:34:03 [INFOS] at java.lang.Thread.run(Unknown Source)
    07:34:03 [INFOS] Enabling level saving..
    07:34:03 [INFOS] ConsoleCommandSender: Enabling level saving..
    07:34:03 [INFOS] Sauvegarder finis
     
  17. Offline

    xZise

    Maybe you can fix this, if you create directory named “custom” in the backup directory.

    Fabian
     
  18. Offline

    Darkaegis

    Any plans to update the thread to mark this as working on the newest version? Works fine for me and it is absolutely the most useful plugin on my server. It has saved my butt many times.
     
  19. Yes, please update the topic if it works for the newest bukkit version. :)
     
  20. Offline

    xZise

    lol? One hour and 23 minutes before you posted this, another user said:
    Fabian
     
  21. Offline

    Jano666

    How to Backup in an other directory?

    My Server is running on D:\Bukkitfolder\
    And i want the Backups on C:\Backups

    (D:/ is an Ramdisk, so its not good to Backup there)
     
  22. Offline

    rurock

    ConsoleCommandSender NEEDS to go away. The amount of spam it sends to clients is ANNOYING.
     
  23. Offline

    nicke937

    I can agree that it's little annoying with the messages in the console. :)
     
  24. Offline

    rurock

    I don't mind the messages in the console so much, just when it send it in game, blah. The people playing don't need to know when the server backs up :p
     
  25. Offline

    Jan Tojnar

     
  26. Offline

    fjutte

  27. Offline

    Drumpie

    Is this plugin not working properly for more people?

    If I do /backup it is starting the backup but it isn't finishing.
     
  28. Offline

    Techknowdude

    Thanks! Great plugin.

    I would like to know if it is possible to save the backup in multiple locations. I'v had hard drives fail on me many times and I really don't want to lose a bunch of work because of that. If not I would love an update adding that feature.

    Thanks again for your work :)
     
  29. Offline

    blaize9

    hmm i get this error, after i upgraded to 1.6
    21:50:24 [INFO] ConsoleCommandSender: Forcing save..
    21:50:24 [INFO] Save complete.
    21:50:24 [INFO] ConsoleCommandSender: Save complete.
    21:50:24 [INFO] Disabling level saving..
    21:50:24 [INFO] ConsoleCommandSender: Disabling level saving..
    21:50:24 [INFO] java.lang.NullPointerException
    21:50:24 [INFO] at threading.BackupTask.backup(BackupTask.java:94)
    21:50:24 [INFO] at threading.BackupTask.run(BackupTask.java:57)
    21:50:24 [INFO] at org.bukkit.craftbukkit.scheduler.CraftWorker.run(CraftWorker.java:34)
    21:50:24 [INFO] at java.lang.Thread.run(Thread.java:662)
     
  30. Offline

    Williamsson

    Just got this error:


    Code:
            14:27:25 [INFO] Start backup
    14:27:25 [INFO] Forcing save..
    14:27:25 [INFO] ConsoleCommandSender: Forcing save..
    14:27:33 [INFO] Save complete.
    14:27:33 [INFO] ConsoleCommandSender: Save complete.
    14:27:33 [INFO] Disabling level saving..
    14:27:33 [INFO] ConsoleCommandSender: Disabling level saving..
    14:27:33 [WARNING] Can't keep up! Did the system time change, or is the server o
    verloaded?
    14:27:34 [INFO] [BACKUP] An error occurs while creating a temporary copy of worl
    d Dertinia. Maybe the complete world isn' backuped, please take a look at it!
    14:27:34 [INFO] java.io.IOException: Map failed
    14:27:34 [INFO]         at sun.nio.ch.FileChannelImpl.map(Unknown Source)
    14:27:34 [INFO]         at sun.nio.ch.FileChannelImpl.transferFromFileChannel(Un
    known Source)
    14:27:34 [INFO]         at sun.nio.ch.FileChannelImpl.transferFrom(Unknown Sourc
    e)
    14:27:34 [INFO]         at io.FileUtils.doCopyFile(FileUtils.java:299)
    14:27:34 [INFO]         at io.FileUtils.doCopyDirectory(FileUtils.java:265)
    14:27:34 [INFO]         at io.FileUtils.doCopyDirectory(FileUtils.java:263)
    14:27:34 [INFO]         at io.FileUtils.copyDirectory(FileUtils.java:231)
    14:27:34 [INFO]         at io.FileUtils.copyDirectory(FileUtils.java:157)
    14:27:34 [INFO]         at io.FileUtils.copyDirectory(FileUtils.java:126)
    14:27:34 [INFO]         at threading.BackupTask.backup(BackupTask.java:77)
    14:27:34 [INFO]         at threading.BackupTask.run(BackupTask.java:57)
    14:27:34 [INFO]         at org.bukkit.craftbukkit.scheduler.CraftWorker.run(Craf
    tWorker.java:34)
    14:27:34 [INFO]         at java.lang.Thread.run(Unknown Source)
    14:27:34 [INFO] Caused by: java.lang.OutOfMemoryError: Map failed
    14:27:34 [INFO]         at sun.nio.ch.FileChannelImpl.map0(Native Method)
    14:27:34 [INFO]         ... 13 more
    But it seems to work fine now when I rebooted the server.
     
  31. Offline

    rurock

    No. Leaving that option blank STILL sends Console Messages to ALL clients. Sure, leaving that blank will not send Starting Backup or Backup Complete, BUT it still sends everything in between; three unnecessary messages.
     

Share This Page