A small command-line tool for backing up, restoring, and syncing Minecraft server worlds.
Written in Rust. No dependencies beyond a Rust toolchain to build, and tmux / rclone if you want to use those features.
Creates a timestamped backup of a server's world directory. If a previous backup exists, unchanged files are hard-linked instead of copied, so backups after the first one are fast and use very little extra disk space.
If you pass --server-session, it will send a save-all command to that tmux session before backing up, then wait 10 seconds for the save to finish.
mc_tools backup --server-dir /path/to/world --backup-dir /path/to/backups [--server-session tmux_session]
Restores a backup into a target directory. Works with either a plain backup folder or a .tar.gz archive.
mc_tools restore --backup-source /path/to/backups/backup_timestamp --restore-dir /path/to/world
Meant to delete backups older than a given retention period. Not implemented yet — running this currently just logs what it would do.
mc_tools purge --backup-dir /path/to/backups [--retention-days N]
Compresses each dated backup folder into a .tar.gz and uploads it to Google Drive using rclone, then deletes the local compressed copy. Requires rclone to be installed and configured with a remote named gdrive (or pass your own with --remote-path).
mc_tools synctogdrive --root-dir /path/to/backups [--remote-path gdrive:]
cargo build --release
A Nix flake and devenv setup are included if you'd rather use those instead of a plain Cargo install.
GPL-3.0