Skip to content

BackupManager

Provides access to the server’s Back-up Manager for creating, restoring, deleting, and configuring back-ups. The backup global exposes the existing ServerObject.backup instance.

View the source: BackupManager

Immediately saves the state of the server to a back-up file. Returns {'name': str, 'size': str, 'date': str}, or None when failed

Restores a back-up from a BackupObject. Use the backup.latest or backup.list attribute to retrieve a BackupObject

ParametersTypeDescription
backup_obj*BackupObjectRetrieve from backup.latest or backup.list

Migrates all the back-up files from the previous directory to the specified new_directory

ParametersTypeDescription
new_directory*strA folder on the filesystem, and will create it if it doesn’t exist

Configures the maximum amount of back-ups that can be saved to backup.directory before overwriting

ParametersTypeDescription
amount*int / strMaximum number of back-ups to retain ('unlimited' to disable the limit)

Enables or disables automatic server back-ups.

ParametersTypeDescription
enabledboolEnable automatic back-ups. Defaults to True.

Deletes the specified BackupObject if it belongs to this server’s back-up list and no back-up operation is active. Returns True if removed, otherwise False.

ParametersTypeDescription
backup_obj*BackupObjectFrom backup.latest or backup.list

backup.return_backup_list(fetch_metadata=True)

Section titled “backup.return_backup_list(fetch_metadata=True)”

Returns a list of the current BackupObject values. With metadata fetching enabled, each object also loads version and modpack metadata stored inside the archive

ParametersTypeDescription
fetch_metadataboolLoad internal metadata for each back-up when True (default)

Returns True while a save operation is in progress for this server

Sets the maximum amount of log data retained with server back-ups

ParametersTypeDescription
limit*int / strMaximum retained back-up log size in MB, or 'unlimited' to disable the limit
AttributeTypeDescription
backup.directorystrDefault filesystem directory to save and restore back-ups from
backup.maximumint / 'unlimited'Shows the maximum amount of back-ups allowed in backup.directory
backup.auto_backupboolShows whether automatic server back-ups are enabled or not
backup.log_limitint / 'unlimited'Maximum retained log size in each back-up (MB)
backup.total_sizeintContains storage utilization in bytes of all back-ups in backup.directory
backup.latestBackupObject / NoneMetadata for the newest back-up; exposes BackupObject.path, BackupObject.size, BackupObject.date, and loaded version/modpack metadata
backup.listlist: BackupObjectFile details of all back-ups sorted from most recent in descending order at backup.list[0]. Exposes BackupObject.path, BackupObject.size, BackupObject.date, and loaded version/modpack metadata