[Discontinued] 💾 ServerBackup [v1.3]

#ServerBackup
ServerBackup is a simple plugin that create backups for your server. There is no permission, only one command you have to execute in the console. You can set which files or folders you want to save in your backup with the java patterns. There is a default config created when you load the plugin for the first time with the patterns you should use to fully backup your server. So if you don’t know the java patterns, you won’t have any configuration to do.

How to use this plugin

Write this command in the console /sb backup or /serverBackup backup and that will create a backup of your server. If you want to set this command on a schedule, you could use my plugin CommandScheduler.

To set the files you don’t want in your backup, you have to set the java patterns inside the config file (config/serverbackup/serverbackup.conf).

Example: the line .jar$ will exclude all the file with extension .jar.

Your config file should look like this:

config\\serverbackup\\backups
.jar$

To delete your older backups, you have to do /sb delete <minute> or /serverBackup delete <minute>. All the backups older than now minus the minutes will be deleted.

Backup

All the backups created are in the file config/serverbackup/backups. They are sorted by date.

Links

4 Likes

#Update 1.1

  • Update to Sponge API 4.0.1
  • Refactor some packages
  • Added the MIT license in the files

Links

Hi djxy,

I’ve run in some trouble while using ServerBackup 1.0 with Prism 3.0.0 beta2 and/or Keys 1.0.1 on a clean test server running SpongeVanilla 1.8.9 3.1.0 BETA 248. Both plugins where made for 3.0.0+.

When I run /sb with one of these plugins installed (with the default configuration) I am receiving the exact same error:

[14:27:27 ERROR] [STDERR]: java.io.IOException: The process cannot access the file because another process has locked a portion of the file
[14:27:27 ERROR] [STDERR]: at java.io.FileInputStream.read0(Native Method)
[14:27:27 ERROR] [STDERR]: at java.io.FileInputStream.read(Unknown Source)
[14:27:27 ERROR] [STDERR]: at io.github.djxy.Sponge.putFileInZip(Sponge.java:138)
[14:27:27 ERROR] [STDERR]: at io.github.djxy.Sponge.putFileInZip(Sponge.java:129)
[14:27:27 ERROR] [STDERR]: at io.github.djxy.Sponge.putFileInZip(Sponge.java:129)
[14:27:27 ERROR] [STDERR]: at io.github.djxy.Sponge.putFileInZip(Sponge.java:129)
[14:27:27 ERROR] [STDERR]: at io.github.djxy.Sponge.access$300(Sponge.java:31)
[14:27:27 ERROR] [STDERR]: at io.github.djxy.Sponge$1.run(Sponge.java:114)
[14:27:27 ERROR] [STDERR]: at java.lang.Thread.run(Unknown Source)

In my ./config/serverbackup/backups folder I found a few .zip files that where marked by Windows as corrupt. Their size is between the 3 - 10KB.
Without the Prism and/or Keys plugin the backups are stored and can be extracted.

Could you please help me.

King regards,
Hiero247

Thank to report me the error, I’ll take a look tonight.

#Update 1.2

  • Fix a bug with the files locked

Links

Thanks for your quick update.

I honestly love the fact that you added a feature that checks for used files.
But this doesn’t solve my problem. I’m now recieving these errors:

[16:59:00] [Thread-16/INFO] [server_backup]: Server backup started.
[16:59:00] [Thread-16/ERROR] [server_backup]: Can’t put C:\Users
Hiero247\Desktop\Server\HieroCraft Server V.1.1.6 (Agareus)\Servers\MineCraft\Kingdom (25580).\config\keys\keys.mv.db in the backup.
[16:59:00] [Thread-16/ERROR] [server_backup]: Can’t put C:\Users\Hiero247\Desktop\Server\HieroCraft Server V.1.1.6 (Agareus)\Servers\MineCraft\Kingdom (25580).\config\prism\db_Kingdom_Prism.mv.db in the backup.

In the description of the plugin you wrote that it is possible to exclude files from the backup. Could you please give me the exact text I need to add to exclude these files.

King regards,
Hiero247

These errors are normal, it advertises you about the files that have not been put in the zip(They were supposed to be in).

If you use the new version of ServerBackup, put this config\\prism\\\w*.mv.db on config\server_backup\server_backup.conf. This line will remove the db files of prism of the backup.

Ah now i get it. The whole configuration file is nothing more than a exception list. Thank you :smiley:

1 Like

Update v1.3

  • New commands
  • /serverBackup is now /serverBackup backup
  • /serverBackup delete
  • Directory changed.
  • config/serverbackup/

Links

So say I want to save my world (preferably in zip or in a dated folder) what should I use for java pattern? Thanks :grinning:

By default all the files on your server are saved. The .jar are not. So your worlds are saved. If your server run on Linux or MacOS you should change this config\\serverbackup\\backups by config/serverbackup/backups. Your backups won’t be saved in your backup.

Salut, y’a un détail un peu bête que je me demandais lorsqu’on entre la commande ./server backup, il effectue une sauvegarde si j’ai bien compris mais, est-ce qu’il enregistre les données des autres plugins car je me suis déjà fait avoir plusieurs fois en tombant sur des backups qui sauvegarder pas les plugins :sweat_smile:.

Il sauvegarde tout les fichiers de ton serveur.

Congrats on what appears to be the best backup option for Sponge so far.

Any chance you could speed up the backup execution? maybe also add some form of compression?

With the same dedicated server:

  • using djxy-ServerBackup-1.3: it takes 2h to backup 10GB without compression.
  • using AutoSaveWorld-4.14.1: it takes less than 2mn to backup 4.6GB compressed into a 1.5GB zip.

Yes, I could optimize that.