胖喵必快

secext2022 9141c3252d 修复(pmbs): 自动清理处理 2 days ago
.github 9141c3252d 修复(pmbs): 自动清理处理 2 days ago
build-aur 0c7f712bd7 添加(pmbs): 优化文档, 禁用 btrfs quota 2 days ago
build-rpm 0c7f712bd7 添加(pmbs): 优化文档, 禁用 btrfs quota 2 days ago
doc 307c710ef8 重置 git 历史 5 days ago
etc 0c7f712bd7 添加(pmbs): 优化文档, 禁用 btrfs quota 2 days ago
src 9141c3252d 修复(pmbs): 自动清理处理 2 days ago
systemd-unit 307c710ef8 重置 git 历史 5 days ago
.gitignore 307c710ef8 重置 git 历史 5 days ago
Cargo.lock 0c7f712bd7 添加(pmbs): 优化文档, 禁用 btrfs quota 2 days ago
Cargo.toml 0c7f712bd7 添加(pmbs): 优化文档, 禁用 btrfs quota 2 days ago
LICENSE 307c710ef8 重置 git 历史 5 days ago
README.md 0c7f712bd7 添加(pmbs): 优化文档, 禁用 btrfs quota 2 days ago
build.rs 307c710ef8 重置 git 历史 5 days ago

README.md

胖喵必快

https://github.com/fm-elpac/pmbs

CI

(每分钟) 创建 btrfs 快照, 并自动清理.

Make btrfs snapshot (every minute), and auto clean.

正式名称: 紫腹巨蚊 (Toxorhynchites gravelyi) 系列 澳大利亚海神草 (Posidonia australis) 软件

免责声明: 这是开源软件, 没有任何担保, 用户应该承担使用本软件造成的一切后果. 如果不能接受, 请勿使用本软件 !


镜像 (mirror):

胖喵必快使用 root 权限创建 只读 btrfs 快照, 所以普通用户 (无 root) 无权限删除快照. 因此可以防止误删文件 (可以从快照找回).

pmbs run as root to create readonly btrfs snapshot, so normal user (no root) can not delete snapshot. So can prevent delete files by mistake (can recovery from snapshot).

安装 (install)

  • ArchLinux (AUR): TODO

或者从 release 下载安装包:

Or download pre-compiled package from release:

  sudo pacman -U pmbs-bin-0.1.0a3-1-x86_64.pkg.tar.zst
  • Fedora CoreOS (RPM):

release 下载安装包:

Download pre-compiled package from release:

  sudo rpm-ostree install pmbs-0.1.0a3-1.fc42.x86_64.rpm

然后重启系统.

And reboot.


安装之后 (after install):

  • (1) 编写配置文件, 比如:

Edit config file, for example:

  cd /etc/pmbs
  sudo cp home.toml.zh.example home.toml  # or home.toml.en.example
  env EDITOR=nano sudo -e home.toml

原则上, 保留规则应该按顺序编写, 上一条规则的间隔时间 (time) 应该比下一条更短, 比如 1m (分钟), 5m, 1h (小时), 1d (天). 同时保留个数 (n) 应该大于 0.

Keep rules should be written in order: time of one rule should be shorter than the next rule, for example: 1m (minute), 5m, 1h (hour), 1d (day). Number to keep (n) should be larger than 0.


注意: 请关闭 btrfs quota !! 当 quota 和大量 snapshot 同时使用, 系统会非常慢 (经常卡死). 检查 quota 是否启用, 比如:

Please disable btrfs quota !! When quota is used with a lot snapshots, the system will be very slow. Check if quota is enabled, for example:

  > sudo btrfs qgroup show /home
  ERROR: can't list qgroups: quotas not enabled

如果启用了, 禁用 quota, 比如:

If quota is enabled, disable it, for example:

  sudo btrfs quota disable /home

参考资料 (reference):

Enable systemd timer (snapshot/clean):

  sudo systemctl enable --now pmbs-snapshot.timer
  sudo systemctl enable --now pmbs-clean.timer

  • 列出指定 subvol 的快照, 比如:

List snapshots of a subvol, for example:

  pmbs ls /home
  • 可以直接使用 btrfs 命令删除快照:

You can delete a snapshot with btrfs command:

https://wiki.archlinux.org/title/Btrfs#Deleting_a_subvolume

常见问题 (FAQ)

TODO

例行更新维护策略 (Release new version policy)

适用于本仓库 (pmbs). 当下列条件任意一条满足时, 本仓库的软件需要发布新的维护版本 (版本号 x.y.z 其中 z + 1). "更新所有依赖" 并重新编译 (构建):

When any of the following is true, this repo should release a new version (version number x.y.z, z + 1). Update all dependencies, and rebuild:

  • rustc 发布新版本 (版本号 x.y.z 其中 xy 变化)

rustc release a new version (version number x.y.z, x or y change)

  • 各依赖或本仓库发布重要的安全更新 (修复比较严重的安全漏洞)

The dependencies or this repo release an important security update.

当前重要依赖的版本号:

Current version number of important dependencies:

  • rustc 1.89.0 (29483883e 2025-08-04)

https://github.com/rust-lang/rust

文档 (doc)

TODO

LICENSE

MIT