Skip to content

Instantly share code, notes, and snippets.

@phmarek
Last active March 15, 2021 10:09
Show Gist options
  • Save phmarek/327fe756992a13683f757daa0d60344a to your computer and use it in GitHub Desktop.
Save phmarek/327fe756992a13683f757daa0d60344a to your computer and use it in GitHub Desktop.
Show progress of BTRFS snapshot removal
#!/bin/bash
P="${1:-.}"
prev=0
while sleep 30 ; do
C=$(btrfs sub list -d "$P" | wc -l)
if [[ "$C" != "$prev" ]]
then
prev="$C"
echo "$(date) $C $(btrfs fi df "$P" | grep ^Meta)"
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment