mirror of
https://github.com/OpenNebula/one.git
synced 2026-11-20 20:02:38 +09:00
bug #1042: use du to calculate image sizes, works with dirs
This commit is contained in:
1 parent
825e5f738e
commit
7993a5b3ec
1 file changed
+3
-3
@@ -64,12 +64,12 @@ echo "$IMAGE_REPOSITORY_PATH/`echo $CANONICAL_MD5 | cut -d ' ' -f1`"
|
||||
}
|
||||
|
||||
function fs_du {
|
||||
SIZE=`stat -c %s $1`
|
||||
SIZE=`du -sk "$1" | cut -f1`
|
||||
|
||||
if [ $? -ne 0 ]; then
|
||||
SIZE=0
|
||||
SIZE=0
|
||||
else
|
||||
SIZE=$(($SIZE/1048576))
|
||||
SIZE=$(($SIZE/1024))
|
||||
fi
|
||||
|
||||
echo "$SIZE"
|
||||
|
||||
Reference in new issue
Block a user