Resolve "When no directories existed in the volume, tar felt obligated to error out..."
This commit is contained in:
parent
2d1c3c377f
commit
4dda4ade66
1 changed files with 50 additions and 46 deletions
|
|
@ -109,7 +109,7 @@ EOF
|
|||
|
||||
backup_configs() {
|
||||
cd "/$volume/._share/"
|
||||
tar -cf "/var/backups/$volume_sharelunconfig.$(date +%s).tar" ./*
|
||||
tar -cf "/var/backups/$volume_sharelunconfig.$(date +%s).tar" ./* 2>/dev/null
|
||||
}
|
||||
|
||||
echo "==============================="
|
||||
|
|
@ -140,7 +140,10 @@ else
|
|||
echo "==============================="
|
||||
for volume in $x; do
|
||||
echo "= Investigating volume /$volume..."
|
||||
objects=$(cd /"$volume"; ls -dA */ | egrep -v "^.apps\/$|^home\/$|^.purge\/$|^._share\/$|^.timemachine\/$|^.vault\/$|^.TemporaryItems\/$" | sed 's/\/$//')
|
||||
objects=$(cd /"$volume"; ls -dA */ 2>/dev/null | egrep -v "^.apps\/$|^home\/$|^.purge\/$|^._share\/$|^.timemachine\/$|^.vault\/$|^.TemporaryItems\/$" | sed 's/\/$//')
|
||||
if [[ $? == 2 ]]; then
|
||||
echo "No shares or LUNs found."
|
||||
else
|
||||
echo "= Objects found:" $objects
|
||||
backup_configs
|
||||
for item in $objects; do
|
||||
|
|
@ -151,6 +154,7 @@ else
|
|||
share_create
|
||||
fi
|
||||
done
|
||||
fi
|
||||
echo "= done with /$volume"
|
||||
done
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue