HeatherComputer / AdvancedBackups

BSD 3-Clause "New" or "Revised" License
38 stars 7 forks source link

Advanced Backups

A powerful backup mod for Minecraft, supporting Neoforge, Forge and Fabric. Many Minecraft versions are supported - request more if the one you want isn't yet supported.

Supported Versions

Features

FAQ

What does each backup type mean?

Ingame Usage

Command Line Usage

Future Plans

Notices

Features:

FAQ:

FAQ:

Backup Types:

Because of the way this "chain" works with incrementals, they purge slightly differently:

Usage:

Ingame:

- Upon first boot, an AdvancedBackups.properties file will be created in your server or client config directory.

- Adjust this to suit your needs, then restart the server or use /backup reload-config in versions 2.2+ or /advancedbackups reload in older pre-2.2 versions to reload the config. A small description of each config entry is below.

config | Config | Description | Default Value | Supported From / Until | | ----------- | ----------- | ------------- | -------------- | | config.advancedbackups.enabled | Enable or disable backups entirely. | true | 0.3 | | config.advancedbackups.save | Whether to save before making a backup. | true | 0.3 | | config.advancedbackups.buffer | The buffer size in memory to use for (some) file I/O. | 1048576 | 3.5 | | config.advancedbackups.flush | Whether to flush when making this save. Usually never needed, and can create a lag spike if enabled. (Unused prior to minecraft 1.16) | false | 3.1 | | config.advancedbackups.activity | Enable or disable player activity requirements. | true | 1.0 | | config.advancedbackups.type | Whether to use zip, differential or incremental backups. | differential | 0.3 | | config.advancedbackups.blacklist | A comma separated list of relative paths to files not to backup. | session.lock | 3.5.1 | | config.advancedbackups.path | The relative or absolute location where backups are stored. | ./backups | 0.3 | | config.advancedbackups.size | The maximum backup size to keep, in GB. Oldest backups are deleted if this is exceeded. | 50 | 0.3 / 3.4 | | config.advancedbackups.frequency.min | The minimum time between backups. Command backups bypass this. | 0.5 | 0.3 | | config.advancedbackups.frequency.max | If this time has passed since a backup was last made, one **will** be made. | 24 | 0.3 | | config.advancedbackups.frequency.uptime| Whether the schedule is based on uptime. If not. it uses real-time instead. | true | 0.3 | | config.advancedbackups.frequency.schedule | Uptime based : a looping uptime-based schedule. Real-time based : A strict schedule, following real-world time. | 1:00 | 0.3 | | config.advancedbackups.frequency.shutdown | Whether to make a backup on server shutdown. | false | 0.3 | | config.advancedbackups.frequency.startup | Whether to make a backup on server startup. | false | 0.3 | | config.advancedbackups.frequency.delay | The delay in seconds before making a startup backup. Always at least 5 seconds. | 30 | 0.3 | | config.advancedbackups.logging.silent | Whether to disable chat and console logging. Does not affect debug.log or error messages. | false | 2.0 / 3.6 | | config.advancedbackups.logging.clients | Which clients to send backup progress info to. | ops | 3.6 | | config.advancedbackups.logging.clientfrequency | How often to send backup progress info to clients, in milliseconds. | 500 | 3.6 | | config.advancedbackups.logging.console | Whether to log backup progress info to console. Start and end are always logged. | true | 3.6 | | config.advancedbackups.logging.consolefrequency | How often to log backup progress info to console, in milliseconds. | 5000 | 3.6 | | config.advancedbackups.purge.size | The maximum total backup size to keep. Moved from `config.advancedbackup.size`, will auto migrate. Optional. | 50 | 3.4 | | config.advancedbackups.purge.days | The maximum number of days to keep backups for. Optional. | 0 | 3.4 | | config.advancedbackups.purge.count | The maximum number of backups to keep. Optional. | 0 | 3.4 | | config.advancedbackups.zips.compression | The attempted compression level for all zip files. | 4 | 0.3 | | config.advancedbackups.chains.length | The maximum chain length for incremental and differential backups. | 50 | 0.3 | | config.advancedbackups.chains.compress | Whether to compress incremental and differential backups into zip files. | true | 0.3 | | config.advancedbackups.chains.smart | For differential and incremental backups. Resets the chain length if every file is being backed up. | true | 0.3 | | config.advancedbackups.chains.maxpercent | If the size of a partial backup exceeds this % of a full backup's size, a full backup is made instead. | 50 | 2.0 | config.advancedbackups.purge.incremental | For incremental backups only. Enable to allow purging incremental backup chains if the defined storage usage is limit exceeded. | true | 1.0 |

Commands:

- All entries in the table below must be prefixed with /backup in 2.2+ or /advancedbackups in older pre-2.2.

pre-2.2 | Command | Description | Supported From | | ----------- | ----------- | -------------- | | check | Checks if a backup would be made at this point in time, and tells you the result. Does not make a backup.| 1.0 | | start | Starts a backup if all checks pass. Tells you check results.| 1.0 | | reload | Reloads the config.| 1.0 | | force-backup | Forces a backup without running any checks.| 1.0 | | reset-chain | Resets any current chain length.| 1.0 |
2.2+ | Command | Description | Supported From | | ----------- | ----------- | -------------- | | start | Makes a backup using the configured backup type.| 2.2 | | reload-config | Reloads the config.| 2.2 | | reload-client-config | Reloads the clientside config.| 3.5 | | snapshot | Creates a "snapshot" backup that cannot be auto-deleted.| 2.2 | | reset-chain | Resets any current chain length.| 1.0 |

Commandline:

- Run the jar directly from the mods folder. java -jar AdvancedBackups-modloader-mcversion-modversion for example, replacing the filename with the correct one for your installation.

- It will read your config. Then, it will check for backups from other mods.

- Afterwards, it will ask you which backup type to restore. It tells you which type is specified in config - use this if you're unsure.

- Next you choose whether you're exporting a backup, restoring the entire backup, or a singular file.

image

- Then it will help find a world - first asking if you play on a client or server, then by listing world names.

image

- Then it will prompt you to choose a backup to restore. The most recent are listed last. With differential and incremental upgrades, the backups will be labelled as partial or full.

- The below image shows this for a differential backup.

image

Finally, you can accept the warning prompt it gives you.

If you chose to restore the entire backup, the program will exit when it is complete.

If you chose to restore a singular file, you'll be presented with a rudimentary file browser.

Directories are marked, and ../ will traverse up a directory.

If your selected backup type is differential or incremental, files will be marked with the date they're from. This is purely for your information, the file's state will match that of when the selected backup was made.

Once you select a file, it will be restored. The program will then exit.

image

Future Plans:

Profiles

Profiles can do this!

Essentially, profiles will be an optional set of additional configs.

These are completely separate - meaning they will not interfere with one another, at all.

The profile system will not be compatible with versions that predate its release.

Upon first load with a version updated to use profiles, a default profile will be made.

More commands

Shortly after release, I wish to add more commands.

Client feedback improvements

API and clientside restoration

I plan to add an API, which will be a rather hefty project. With this done however:

Notices: