[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


    No sudo here :D And the admin is atm afk.

  3. Offline


    Can you make it where we can use colors (such as &d) in the backup messages that are broadcasted to players?

    Also - do you think this will lag the server if my map is 2.x-3.x GB in size and has anywhere between 50-150 players online on average?
  4. Offline


    Maybe it will lag a few seconds, but using a other thread for making the disc operation instead of the main server thread shall avoid lags. But I'm opened for live tests results^^
  5. Offline


    It seems if I use the /restart command... the backup plugin goes nuts. I dont need to do this often but when I change permissions the restart command will make them effective without kicking everyone off of the server...

    The bug is, I end up with several versions of a backup all with the same time stamp all with different file sizes.
  6. Offline


    Sorry, but I can't follow you. Maybe I was getting up a few minutes ago, but do not understand you.

    When you use /reload , what is happening with the plugin?

    And what do you mean with the bug. You have two or more files with the same name and different attributes like creation date and size, haven't you?
  7. Offline


    Sorry, I'll try again.

    I have the backup plugin configured to back up every 3 hours and store 24 backups max.. If I use the /reload command on the server, the next time the backup script fires off for its 3 hour backup, it seems to try and create x # of backups at the same time; where x = number of times I have used /reload.

    For example: Lets say I have used /restart a few times to make permission changes effective. If the script was set up to fire off a backup at 8:59, the result is several broken or incomplete backups all time stamped 8:59 and of varying size. Some even 0.0 bytes.

    If I stop the server and open a fresh instance its fine, but this kicks everyone out for a moment.

    I will try to take a screenshot of this tonight.
  8. Offline


    I'm running CB 766 and Backup doesn't zip the backups or save all of my worlds. (Only backs up the default world called 'world')

    Here's my config.
  9. Offline


    I used this with the snapshot feature of worldedit. With the new save method I no longer can. is there a way to go back to just putting all the worlds in one folder?
  10. Offline


    Explain this. To you want to have backups titled worldTIMESTAMP and consisting of only one world instead of having all in one folder/zip?
  11. Offline


    Yes. Or the option to have it like so. Worldedit needs to have all world backups in the same folder in order to use the snapshot function. Like it was before... =P
    Lapppy likes this.
  12. Offline


    I keep getting this -
    Help please =/.
  13. Offline


    I too am having this issue.
    Lapppy likes this.
  14. Offline


    Hi,...I also would like to use these backup as snapshots to WorldEdit,...
    so the Zip file need look like this:
    |-- [players]
    |-- [regions]
    |-- level.dat
    |-- session.lock
  15. Offline


    So i set my config to only save 10 backups then rewrite the oldest one, i now have 70 backups... it just keeps on making them until there is no space left...
  16. Offline


    I think something in your config is wrong. Can I see the content?
  17. Offline


    Can you please tell me what is going on with this error and how to fix it? Would really love to use this plugin.
    The plugin runs for about 5 seconds, then gives that error. It shows a backed up world, but i highly doubt it works right. Our map is 1.8GB and nothing can back that up in 5 seconds. I hope this is a fixable error.

    15:35:32 [INFO] Start backup
    15:35:32 [INFO] Forcing save..
    15:35:32 [INFO] ConsoleCommandSender: Forcing save..
    15:35:32 [INFO] Saving chunks
    15:35:32 [INFO] Save complete.
    15:35:32 [INFO] ConsoleCommandSender: Save complete.
    15:35:32 [INFO] Disabling level saving..
    15:35:32 [INFO] ConsoleCommandSender: Disabling level saving..
    15:35:32 [INFO] [BACKUP] Backup compression is disabled.
    15:35:40 [INFO] java.io.FileNotFoundException: world/players/l�opip.dat (No such file or directory)
    15:35:40 [INFO]        at java.io.FileInputStream.open(Native Method)
    15:35:40 [INFO]        at java.io.FileInputStream.<init>(FileInputStream.java:137)
    15:35:40 [INFO]        at io.FileUtils.doCopyFile(FileUtils.java:289)
    15:35:40 [INFO]        at io.FileUtils.doCopyDirectory(FileUtils.java:264)
    15:35:40 [INFO]        at io.FileUtils.doCopyDirectory(FileUtils.java:262)
    15:35:40 [INFO]        at io.FileUtils.copyDirectory(FileUtils.java:230)
    15:35:40 [INFO]        at io.FileUtils.copyDirectory(FileUtils.java:156)
    15:35:40 [INFO]        at io.FileUtils.copyDirectory(FileUtils.java:125)
    15:35:40 [INFO]        at threading.BackupTask.backup(BackupTask.java:74)
    15:35:40 [INFO]        at threading.BackupTask.run(BackupTask.java:57)
    15:35:40 [INFO]        at org.bukkit.craftbukkit.scheduler.CraftWorker.run(CraftWorker.java:34)
    15:35:40 [INFO]        at java.lang.Thread.run(Thread.java:636)
  18. Offline


    thank you. I appreciate your work!
  19. Offline


    Hi all,
    is it recommended to use a additional "save-all" plugin to this backup?
    I'm asking because "performabce-tweak" im also using and don't know if it toooo much
  20. Offline

    Sir Ducksworth

    Can I choose where the zip files are saved? Like on a seperate hard drive? Because im using a seperate hardrive for my backups.
  21. Offline


    Yeah... I don't know. If your worlds are small and a backup every 15 minutes doesn't matter you needn't a auto save plugin.
    But if you only want a backup once a day, a autosave plugin is a good addition.

    I will implement this in next version, at first i want to collect bug reports and try to fix them.

    what name has the file? world/players/l�opip.dat ?
  22. Offline


    Thank you,
    so i removed the "autosave plugin" because "Performance tweaks" makes also "auto-save"
  23. Offline


    Hello, why does I have sometimes only directories in the backup directory?

    fabian@XXX-XXX-XXX-XXX:~/servers/766$ ls backups/ -l
    total 9797564
    drwxr-xr-x 5 fabian fabian      4096 May 14 21:21 14052011-212147
    -rw-r--r-- 1 fabian fabian 357949099 May 15 06:16 15052011-061245.zip
    -rw-r--r-- 1 fabian fabian 357949279 May 15 06:30 15052011-062745.zip
    drwxr-xr-x 4 fabian fabian      4096 May 15 06:43 15052011-064300
    -rw-r--r-- 1 fabian fabian 357948647 May 15 07:01 15052011-065816.zip
    -rw-r--r-- 1 fabian fabian 357948627 May 15 07:14 15052011-071324.zip
    drwxr-xr-x 4 fabian fabian      4096 May 15 07:28 15052011-072839
    -rw-r--r-- 1 fabian fabian 357948608 May 15 07:44 15052011-074354.zip
    drwxr-xr-x 4 fabian fabian      4096 May 15 07:58 15052011-075855
    -rw-r--r-- 1 fabian fabian 357948805 May 15 08:21 15052011-082029.zip
    -rw-r--r-- 1 fabian fabian 357949527 May 15 09:33 15052011-093233.zip
    -rw-r--r-- 1 fabian fabian 357958252 May 15 09:48 15052011-094733.zip
    drwxr-xr-x 5 fabian fabian      4096 May 15 10:03 15052011-100301
    -rw-r--r-- 1 fabian fabian 357954341 May 15 10:20 15052011-101802.zip
    drwxr-xr-x 4 fabian fabian      4096 May 15 10:33 15052011-103301
    -rw-r--r-- 1 fabian fabian 357955487 May 15 10:51 15052011-104851.zip
    -rw-r--r-- 1 fabian fabian 357954755 May 15 11:08 15052011-110741.zip
    -rw-r--r-- 1 fabian fabian 357954463 May 15 13:18 15052011-131623.zip
    -rw-r--r-- 1 fabian fabian 357956023 May 15 13:32 15052011-133138.zip
    -rw-r--r-- 1 fabian fabian 357955224 May 15 13:48 15052011-134708.zip
    -rw-r--r-- 1 fabian fabian 357955433 May 15 14:03 15052011-140223.zip
    drwxr-xr-x 4 fabian fabian      4096 May 15 14:18 15052011-141834
    -rw-r--r-- 1 fabian fabian 357954657 May 15 14:37 15052011-143413.zip
    -rw-r--r-- 1 fabian fabian 357956126 May 15 14:50 15052011-144911.zip
    -rw-r--r-- 1 fabian fabian 357953820 May 15 15:05 15052011-150436.zip
    -rw-r--r-- 1 fabian fabian 357953943 May 15 15:21 15052011-152020.zip
    -rw-r--r-- 1 fabian fabian 357951965 May 15 15:40 15052011-153944.zip
    -rw-r--r-- 1 fabian fabian 357951178 May 15 18:00 15052011-175735.zip
    -rw-r--r-- 1 fabian fabian 357951618 May 15 19:11 15052011-190722.zip
    -rw-r--r-- 1 fabian fabian 357949640 May 15 19:34 15052011-193120.zip
    drwxr-xr-x 4 fabian fabian      4096 May 15 23:40 15052011-234028
    drwxr-xr-x 4 fabian fabian      4096 May 16 04:35 16052011-043522
    -rw-r--r-- 1 fabian fabian 357944774 May 16 04:57 16052011-045058.zip
    -rw-r--r-- 1 fabian fabian 357945264 May 16 05:13 16052011-050626.zip
    -rw-r--r-- 1 fabian fabian 357943696 May 16 05:31 16052011-052501.zip
    -rw-r--r-- 1 fabian fabian 357945545 May 16 08:22 16052011-081905.zip
    -rw-r--r-- 1 fabian fabian 357944450 May 16 08:46 16052011-084325.zip

  24. can you pleas edit the save file dates to 2011-12-30 19-48 BACKUP NUMBER. because now the backups from 11-04-2011 are mixed with the updates from may and march it is now hard to find the correct backup. And the year-month-day combination is a standard in saving imported files on the correct version ;)

    a setting in the configuration file is even better so can users choice what thy want :)
  25. Offline


    There is a setting?
    // Custom date format string that is appended to every backup
    // If left empty, the default date format is used
    // This has to be a correct Java String.format string, see
    // http://download.oracle.com/javase/1.5.0/docs/api/java/util/Formatter.html#syntax
    // for reference.
    // Example: -%1$tFT%1$tH%1$tM (ISO 8601 conforming!)
  26. Offline

    Robby Stolle

    is there a way to make max backups unlimited?
  27. Offline


    Yep look in the OP. It is more than obvious.

  28. Offline


    I'm getting an issue with this where it's ignoring the config, and trying to backup our 1.1gig map every 15 minutes, oddly enough the server is not amused.

    Config is completely default except where I changed the minutes to 120. No error in console, have rebooted the server to no avail.
  29. Offline


    Can you make it store each world in different zips?
  30. Offline


    I also used this plugin for WorldEdit snapshots... (actually I still am, just using an outdated version)
  31. Offline


    Yes, that was actually what I wanted... But in theory, world edit doesn't have snapshot suppot for multible worlds, has it?

Share This Page