Miscellaneous Core Documentation
- bedrock_server_manager.core.downloader.prune_old_downloads(download_dir: str, download_keep: int)
Removes the oldest downloaded server ZIP files from a directory.
This function keeps a specified number of the most recent downloads and deletes the rest to manage disk space.
- Parameters:
download_dir – The directory containing the downloaded
bedrock-server-*.zip
files.download_keep – The number of most recent ZIP files to retain.
- Raises:
MissingArgumentError – If download_dir is not provided.
UserInputError – If download_keep is not a non-negative integer.
AppFileNotFoundError – If download_dir does not exist.
FileOperationError – If there’s an error accessing or deleting files.