- 🖥️ TUI — A fast and keyboard-driven terminal interface.
- 📦 Snapshot Groups — Manage any combination of Btrfs subvolumes, including multiple Linux installations on the same filesystem.
- ⏰ Scheduled Snapshots — Automatically create snapshots at scheduled intervals.
Installation
-
Arch Linux
yay -S tram_btrfs
-
Cargo
Installing via
cargodoesn't support shell completion and boot service. See the section below to manually generate shell completion and install boot servicecargo install tram_btrfs
Boot Service
-
If you want the program to check snapshot schedule every time your system boots, enable the following Systemd service:
systemctl enable tram_btrfs.service -
This service simply execute
tram_btrfs --bootduring system startup. So if you're NOT using Systemd, configure your init system to run this command at boot instead. -
The program also checks the schedule whenever it starts. However, boot snapshots are only created when running with
--bootflag. -
If you installed via
cargoor directly download the GitHub release, you may need to install boot service manually: If you're using Systemd, execute this(if not, see above):sudo curl -Lo '/usr/lib/systemd/system/tram_btrfs.service' 'https://raw.githubusercontent.com/Xiaomony/tram_btrfs/main/packaging/systemd/tram_btrfs.service'
-
Snapshots are managed in groups. A snapshot group is a collection of subvolumes that are snapshotted together. You can create, rename, delete groups in "Groups" section. And if your Btrfs system contains "@" and "@home" subvolumes, it will automatically create a "default" group the first time you launch it.
-
The program can automatically create scheduled snapshots(daily, weekly, monthly and boot snapshots). In "Settings" section, you can set the maximum count of each type of scheduled snapshots. To enable the boot snapshots, see the Setup section above.
-
The keybindings are Vim-like and there's prompts below the menu as well.
-
The program stores its configuration in
~/.config/tram_btrfs/tram.toml. Since it requires root privileges to perform Btrfs operations, the configuration file will be stored in/root/.config/tram_btrfs/when the program is run withsudo. -
By default, the program detects the Btrfs device containing the currently running Linux system and mounts it at
/run/tram_btrfs/. But you can specify any Btrfs devices using--deviceflag.(tram_btrfs --device '/dev/nvme0n1p8'for example)
If you installed via cargo or directly download the GitHub release, you may need to generate the shell completion manually:
- Install system-wide
- Bash
tram_btrfs completion bash | sudo tee /usr/share/bash-completion/completions/tram_btrfs >/dev/null
- Zsh
tram_btrfs completion zsh | sudo tee /usr/share/zsh/site-functions/_tram_btrfs >/dev/null
- Fish
tram_btrfs completion fish | sudo tee /usr/share/fish/vendor_completions.d/tram_btrfs.fish >/dev/null
- Bash
- Install for current user
- Bash
mkdir -p ~/.local/share/bash-completion/completions tram_btrfs completion bash >~/.local/share/bash-completion/completions/tram_btrfs
- Zsh
Then add the following to your
mkdir -p ~/.zsh/completions tram_btrfs completion zsh >~/.zsh/completions/_tram_btrfs
.zshrcif needed:fpath=(~/.zsh/completions $fpath) autoload -Uz compinit compinit - Fish
mkdir -p ~/.config/fish/completions tram_btrfs completion fish >~/.config/fish/completions/tram_btrfs.fish
- Bash
Tram is licensed under the GNU General Public License v3.0 or later (GPL-3.0-or-later).
See the LICENSE file for the full license text.

