Skip to content

Specifying what to Backup

LRMtheBoss edited this page Apr 14, 2024 · 6 revisions

By default, DriveBackupV2 backs up the world and plugins folders inside the folder containing the Minecraft server jar. However, you can specify to backup any file/folder, inside or outside the folder containing the Minecraft server jar.

backup-format-timezone

Since v1.3.0

The timezone of the backup zip files' naming format. Don't know your timezone? Find it here.

backup-list

The list of files/folders to back up.

An entry consists of four things:

  • The file/folder path or glob
  • The file name format of the zip file to create
  • Whether this plugin should create the backup, or just upload it
  • Files to not include in the backup (optional)

path

The file/folder path should be the path to the file/folder you want to backup, relative to the folder your server jar is in. You can learn more about relative file paths here.

To avoid overwriting data, .. only affects the local current working directory.

format

The file name format is the naming scheme of the zip file that will be created, this should contain a timestamp. The %FORMAT placeholder is a predefined time and date format of yyyy-mm-dd--hh-mm. You can include a timestamp using date and time pattern letters. You can learn more about date and time pattern letters here.

glob

Since v1.3.8

Backs up all folders matching the file glob specified. When this setting is present, the path setting does not apply. Entries using the glob setting and entries using the path setting can be present in the same backup-list. It is important to note that each folder matching the specified file glob is still backed up in separate zip files. The %NAME placeholder in the format setting will be replaced with the name of the folder being backed up.

For example, this backup-list using globbing:

backup-list:
- glob: "world*"
  format: "Backup-%NAME-%FORMAT.zip"
  create: true

Would be equivalent to this backup-list using path:

backup-list:
- path: "world"
  format: "Backup-world-%FORMAT.zip"
  create: true
- path: "world_nether"
  format: "Backup-world_nether-%FORMAT.zip"
  create: true
- path: "world_the_end"
  format: "Backup-world_the_end-%FORMAT.zip"
  create: true

create

Whether to or to not create a zip backup for the specified path and instead backup a zip file created by another plugin in the backup-folder/path folder.

blacklist

Works differently since v1.3.0

A list of file globs. Files/folders matching a glob will not be included in the backup.

Examples of file globs:

  • *.jar will blacklist all files with the jar extension
  • dynmap/** will blacklist all files in the dynmap folder
  • **/config.yml will blacklist all files named config.yml

To learn more about globbing, click here.

Examples

An example of a backup list:

backup-list:
- path: "world"
  format: "Backup-world-%FORMAT.zip"
  create: true
- path: "plugins"
  format: "Backup-plugins-%FORMAT.zip"
  create: true

An example of a backup list with a blacklist:

backup-list:
- path: "world"
  format: "Backup-world-%FORMAT.zip"
  create: true
- path: "plugins"
  format: "Backup-plugins-%FORMAT.zip"
  create: true
  blacklist:
  - "**/*.jar"
  - "dynmap/**"
  - "**/config.yml"

How do you back up all of the files in the Minecraft server directory?

Works differently since v1.3.0

Backing up all the files in the folder containing the Minecraft server jar is possible, but not recommended. This is because the backups will contain files not needed to restore or rollback the Minecraft server, and the size of the backups will be increased significantly.

Replace the backup list with the following:

backup-list:
- path: .
  format: "Backup-server-%FORMAT.zip"
  create: true