[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

    MakoShark

    I'm getting an error in the console when it tries to disable level saving.

    >backup
    14:58:18 [INFO] Backup starting
    14:58:18 [INFO] Forcing save..
    14:58:18 [INFO] ConsoleCommandSender: Forcing save..
    14:58:19 [INFO] Save complete.
    14:58:19 [INFO] ConsoleCommandSender: Save complete.
    14:58:19 [INFO] Disabling level saving..
    14:58:19 [INFO] ConsoleCommandSender: Disabling level saving..
    14:58:20 [INFO] java.lang.ArrayIndexOutOfBoundsException: 4
    14:58:20 [INFO] at threading.BackupTask.deleteOldBackups(BackupTask.java:155)
    14:58:20 [INFO] at threading.BackupTask.backup(BackupTask.java:116)
    14:58:20 [INFO] at threading.BackupTask.run(BackupTask.java:57)
    14:58:20 [INFO] at org.bukkit.craftbukkit.scheduler.CraftWorker.run(CraftWorker.java:34)
    14:58:20 [INFO] at java.lang.Thread.run(Thread.java:680)
    14:58:20 [INFO] Enabling level saving..
    14:58:20 [INFO] ConsoleCommandSender: Enabling level saving..
    14:58:20 [INFO] Backup completed :)

    Each time I perform the backup the number goes up by 1 next to java.lang.ArrayIndexOutOfBoundsException:
    Anyone know what is causing this and how to fix it?

    Just noticed that is also not deleting backups when the limit is hit.
     
  3. Offline

    xZise

    Where do you store the backup? I get the error, if I don't store it in the default backup path.

    Fabian
     
  4. Offline

    MakoShark

    I store the backup on my external hard drive in a backup directory. What is the default backup path?
    The path that is in the config file is: /Volumes/Mac/Bukkit_backups
     
  5. Offline

    xZise

    The default backup path is relative to the craftbukkit.jar and simply "backups". I have also this error and also a different backup path (but on the same hard drive).

    Fabian
     
  6. Offline

    Haekon

    Super-awesome programmer guy....you in the super-awesome programmer suit....yeah....you...

    It seems that Win7 don't like the plugin...granted I havent read *every* page of this thread....there a workaround?

    I've kept my anti-MS propaganda to myself for the sake of congeniality. Let's stay in the light.

    EDIT: BY 'doesn't like the plugin, i mean, win7 says *F*U* to editing the directory...yay for Balmer growing a pair and enacting permissions, but still....you'r playing catchup....lol katsup.

    Mr. Burns/Balmer is confused....please edjumacate him. Your dog & pony show is VITAL to my 3 ring circus....

    I'm drunk as a skunk, but at least I can spell (and I got chicken) (better than Leeeeeeeerrrrrooooooy Fakinssssssss.....luls for anybody who believed him)

    Anyhow....I expect that this issue doesnt happen in Linux...../chuckle
     
  7. Offline

    grifOndOr

    hmm
    i don't know exactly if this plugin autosave ?

    It backups the world(s) and autosave at the same time ok , but is there an autosave like every 5mn or something like that ?
    I don't want to autobackup every 5mn , it makes the server laging
     
  8. This plugin needs autosave times to be adjustable, as in shorter autosaves, longer backups.
     
  9. Offline

    EcoMaster21

    Doesn't happen on my copy of Windows 7.
     
  10. Offline

    repeat

    great plugin many time help me.

    suggestion: make ignore list folder/files (support wildcart)
    no need make backup something like tiles from dynmap
     
  11. Offline

    iFrederic

    Why does the plugin creates folders and not only the .zip files? There are my .zip backups and sometimes there are also folders with the backups. What's up there?
     
  12. Offline

    grifOndOr

    Could it be possible to not include some plugins in the backup ? like DontBackupPlugins=...
    Backup the entire Dynmap with hires take some place and time ^^

    It would be a great update if you do this :)
     
  13. Offline

    Bronski

    This anti-drinking PSA is brought to you by Schlitz.
     
  14. Hey just an idea, but I think it would be cool if you could disallow certain plugins from being backed up

    I got the dynmap plugin, and that has 1gb of images stored (i only have about 100mb of other stuff), and i'm not really bothered about backing that up :)
     
  15. Offline

    avatera

    Hey I was curious where do the map's get saved too also are there any comamnds if so could you list them
     
  16. The maps get saved in web/tiles i think, i temporarily removed the plugin because i don't want a new gb file being written to my computer every 15 mins >.<
     
  17. Offline

    johndoeloldr

    Is there a way to add color? I can't believe I haven't seen the option for it...
     
  18. Offline

    KingNewbs

    UPDATE: Sorry, I was wrong about the workaround I recommended. I was only able to sto pgetting the error once I switched my backup directory back to the default "backups" folder.

    Original Post:

    I see that some people have encountered the java.lang.ArrayIndexOutOfBoundsException as well. This is happening when there are fewer backup ZIPs in the backups folder than are set in the MaximumBackups variable. Like, if you have MaximumBackups=10, and there are only 8 ZIPS in the backup folder, you will get this error 2 more times. And then once there are 11 backups, you'll never see it again. All the plugin needs is a way to gracefully handle this error and it'll stop throwing up this exception.

    Not sure if that helps anyone, but I tested it and figured I'd share what I found.

    Code:
    21:26:45 [INFO] Forcing save..
    21:26:45 [INFO] ConsoleCommandSender: Forcing save..
    21:26:46 [INFO] Save complete.
    21:26:46 [INFO] ConsoleCommandSender: Save complete.
    21:26:46 [INFO] Disabling level saving..
    21:26:46 [INFO] ConsoleCommandSender: Disabling level saving..
    21:27:01 [INFO] java.lang.ArrayIndexOutOfBoundsException: 2
    21:27:01 [INFO]     at threading.BackupTask.deleteOldBackups(BackupTask.java:155)
    21:27:01 [INFO]     at threading.BackupTask.backup(BackupTask.java:116)
    21:27:01 [INFO]     at threading.BackupTask.run(BackupTask.java:57)
    21:27:01 [INFO]     at org.bukkit.craftbukkit.scheduler.CraftWorker.run(CraftWorker.java:34)
    21:27:01 [INFO]     at java.lang.Thread.run(Thread.java:679)
    21:27:01 [INFO] Enabling level saving..
    21:27:01 [INFO] ConsoleCommandSender: Enabling level saving..
    21:27:01 [INFO] Finished backup!
    Also: I've noticed that even when you have a different BackupDir set than the default "Backups" that folder is still created and if you delete it, you will get errors from the plugin. Like, if you set BackupDir=MyBackups you will have both the "Backups" folder and the "MyBackups" folder created in the main minecraft directory. And if you delete the one you aren't using, or if you delete the "Custom" folder inside there, it will throw up an error from the Backups plugin.

    Obviously, this "Custom" folder indicates that you've selected a custom folder for backups, but I figured I'd point this out too in case anybody else wondered about it.

    All that said: BACKUP IS A GREAT PLUGIN! It saved my bacon today when the power went out and my server's HD completely fried itself. I only lost 30 minutes of world-building thanks to this awesome plugin.
     
  19. Offline

    monir

    Is this still working god for build 1000 i get lagg after backup complete these days
     
  20. Offline

    repeat

    To not make backup tiles of dynmap i changed tilespath in config dynmap.

    # The path where the tile-files are placed.
    tilespath: ../../web/tiles
     
  21. Offline

    Hamster Dough

    I set the maximum backups to 3 so does the newest backup overwrite one of the older backups if the backups folder is already full?
     
  22. Offline

    Frvwfr3

    Yes.
     
  23. Offline

    KingNewbs

    Works perfectly with CraftBukkit 1060, in case anybody wondered.

    Somebody should update the topic title already! :D
     
  24. For those who cannot backup to a seperate backup location, not in the minecraft folder.. You have to name the backup destination as the one already made "backups".

    My settings are: BackupDir=E:\MAPBACKUPS\backups

    Hope it helps out!

    Thanks for the plugin!
     
  25. Offline

    sorklin

    I'm having the same problem. Why can't it just be fixed in the code? Seems like it wouldn't be hard to fix the delete routine to grab the correct directory and files.
     
  26. Offline

    p3king

    Thanks, was scrolling for that post :)
     
  27. Offline

    jxxxxh

    (ConsoleCommandSender: Forcing save..)
    (ConsoleCommandSender: Save complete.)
    (ConsoleCommandSender: Disabling level saving... )

    Does anybody know why whenever the world backsup, ConsoleCommand displays the messages above? It may have to do with the plugin's "EnableAutoSave" command or turning save-on/off in server.properties. Is there a way to remove these messages? It fills up the chat area and makes it look messy. Thanks.
     
  28. Offline

    Kaosvf

    Does it works for #1060?
     
  29. Offline

    repeat

  30. Offline

    Snakybo

    I like this plugin alot, just 1 request.
    My server is running on a VPS (www.verygames.us) the backups are stored there to, but would it be possible to let them save to my pc instead of the vps? with some kind of script or maby even mqsql?
     
  31. Offline

    Valdiralita

    Hey!

    I use this plugin and it works perfectly!
    But i have to make a request: What about to save not the whole plugin folder (its very big) but save a single plugin folder. For me it would be "MultiInv" and the players inventorys are saved there!
    Would be really cool.

    regards Valdiralita
     

Share This Page