dotfiles/.config/zsh/functions/btrfs-snapshot-compare

13 lines
264 B
Plaintext
Raw Normal View History

2022-03-26 17:53:28 +01:00
#!/usr/bin/env zsh
# Compare 2 Btrfs snapshots
setopt LOCAL_OPTIONS ERR_RETURN NO_UNSET PIPE_FAIL
2022-04-03 06:43:18 +02:00
autoload -U die
2022-05-15 12:00:34 +02:00
[[ ${ARGC} -ne 2 ]] && die 1 "usage: ${0} <old> <new>"
local old=${1}
local new=${2}
2022-03-26 17:53:28 +01:00
2022-05-15 12:00:34 +02:00
btrfs send --no-data -p ${old} ${new} | btrfs receive --dump