There are several times where customers are

mistakenly creating folders where there should be btrfs subvolumes,
so this script will check now to see if it is valid.
I plan to add a migrate-to-proper-subvolume feature later.
This commit is contained in:
Cody Cook 2019-04-01 11:30:57 -07:00
commit 618899ba8f

View file

@ -172,12 +172,18 @@ else
if [[ $? == 2 ]]; then if [[ $? == 2 ]]; then
echo "No shares or LUNs found." echo "No shares or LUNs found."
else else
objects=$(echo "$objects" |egrep -v "^.apps\/$|^home\/$|^.purge\/$|^._share\/$|^.timemachine\/$|^.vault\/$|^.TemporaryItems\/$" | sed 's/\/$//;s/\.\///') objects=$(echo "$objects" |egrep -v "^.apps\/$|^\.\/home\/$|^.purge\/$|^._share\/$|^.timemachine\/$|^.vault\/$|^.TemporaryItems\/$" | sed 's/\/$//;s/\.\///')
echo "= Objects found: $(echo $objects | wc -w)" echo "= Objects found: $(echo $objects | wc -w)"
echo $objects echo $objects
backup_configs backup_configs
for item in $objects; do for item in $objects; do
echo "== Reviewing $item" echo "== Reviewing $item"
btrfs subv show /"$volume"/"$item" &>/dev/null
if [[ $? -eq "1" ]]; then
echo "WARNING! /$volume/$item is NOT a valid btrfs subvolume, so it may not appear in the UI."
echo "We will create the configs, but will work on a migration feature later to proper btrfs subvolume."
fi
if ls -QdA /"$volume"/"$item"/.iscsi >/dev/null 2>&1; then if ls -QdA /"$volume"/"$item"/.iscsi >/dev/null 2>&1; then
iscsi_create iscsi_create
else else