fix find_subvolumes
parent
3112ba0288
commit
79a85da5b2
|
@ -90,13 +90,14 @@ echo "~ $((subvolumeFolderSize/1024/1024)) GB"
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# https://unix.stackexchange.com/questions/93324/how-does-this-find-command-using-find-exec-sh-c-sh-work
|
||||||
find_subvolumes() {
|
find_subvolumes() {
|
||||||
dir=${1:-.}
|
dir=${1:-.}
|
||||||
dep=${2:-1}
|
dep=${2:-1}
|
||||||
sudo /bin/find "$dir" -maxdepth $dep -type d -exec bash -c '
|
sudo /bin/find "$dir" -mindepth 1 -maxdepth $dep -type d -exec bash -c '
|
||||||
for d do
|
for d do
|
||||||
subv=$(basename $d)
|
subv=$(basename $d)
|
||||||
sudo $BTRFS_BIN subvolume show "$d" >/dev/null 2>&1 && printf "%s\n" "$subv"
|
sudo '$BTRFS_BIN' subvolume show "$subv" >/dev/null 2>&1 && printf "%s\n" "$subv"
|
||||||
done' find-sh {} +
|
done' find-sh {} +
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue