Created
March 31, 2018 07:08
-
-
Save joe-speedboat/0de074b0441a74a29bd34583f728006c to your computer and use it in GitHub Desktop.
thincopy a vm folder to other disk on esxi
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
thincopy (){ | |
FROM="$1" | |
TO="$2" | |
mkdir -p "$TO" | |
echo "INFO: tincopy $FROM/ $TO/$F" | |
find "$FROM" -type f -not -iname '*.vmdk' -exec cp -a "{}" "$TO/" \; | |
find "$FROM" -type f -iname '*.vmdk' | while read vmdk | |
do | |
F="`basename $vmdk`" | |
vmkfstools -i "$vmdk" -d thin "$TO/$F" | |
done | |
echo "INFO: tincopy done ----------" | |
ls -als "$TO/$F" | |
du -hcs "$FROM" "$TO/$F" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment