Butter
butter (until someone finds a better name) is/will be a bash utility to
manage btrfs subvolumes.
Quickstart
Needed folders
# butter_dir=/mnt/butter/"$(if [ -r /etc/machine-id ]; then cat /etc/machine-id; else uname -r; fi)"
# mkdir -p "$butter_dir"
# for fs in $(lsblk -fl|awk '{ if ($2 ~ "btrfs") print $3 }'); do
mkdir -p "$butter_dir/$fs"
mount -osubvol=/ /dev/disk/by-uuid/"$fs" "$butter_dir/$fs"
mkdir -p "$butter_dir/$fs/__butter"
doneTake snapshots
# butter snapshot /
# butter snaplist
MOUNTPOINT TYPE DATE UUID
/ default Sun Dec 20 16:52:44 CET 2015 082df386-98c2-44d9-9012-07fb2b22ea20Take automated snapshots
# butter add /,/home,/var hourlyAnd then you can add to your cron or w/e:
butter snapshot ALL type hourlyQuestions?
-
Why bash? It is only targeted for Linux, so bash it is.
-
Why butter? Because ButterFS, I guess.
Installation
You can run a "portable" version pretty easily:
git clone git@github.com:moviuro/butter.git
cd butter
./butter helpIf you run Archlinux, there is a PKGBUILD available on the AUR. TL;DR:
cp butter /usr/bin/mkdir -p /usr/lib/butter/ && cp lib-btr/* /usr/lib/butter/butter.8goes to wherever manpages goLICENSEgoes to wherever licenses go
Bugs
If you can't patch the bugs you find, please open an issue on github or gitlab
describing the issue and append the output of butter -d that triggers the bug
you found.