Wednesday, November 23, 2011

Solaris: calculate diff filesystem size after transfer

#! /bin/sh
value1=`df -k /app/iwstoreEMEA_snap| grep snap| awk '{print $3}'`
value2=`df -k /server4_EMEA | grep _EMEA | awk '{print $3}'`
exprans=`expr $value1 - $value2`
echo "$exprans kb left"
sleep 60
value1=`df -k /app/iwstoreEMEA_snap| grep snap| awk '{print $3}'`
value2=`df -k /server_EMEA | grep _EMEA | awk '{print $3}'`
exprans1=`expr $value1 - $value2`
transfer=`expr $exprans - $exprans1`
echo "$transfer KB transferd"



$ sh a.sh
42318487 kb left
14891 KB transferd