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

13 lines
272 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
[[ ${ARGC} -ne 2 ]] && die 1 "Usage: ${0} <old> <new>"
2022-03-26 17:53:28 +01:00
local old="${1}"
local new="${2}"
btrfs send --no-data -p "${old}" "${new}" | btrfs receive --dump