Shell Script - Size Estimation - How much mount point size needed for unzipping a patch/zip file?

Linux File Size Estimation
Disk Space Size Estimation without unzipping the files

Common Mistakes / Issues
1. Improper unzipping of patches leads to patching failure
2. Unzipping binger patches under /root filesystem may crash the servers due to filesystem full
3. Unzipping binger patches under /u01 filesystem may crash the databases

size_est.sh
find /u01/patches -name "p*.zip" -print ]] /u01/patches/zipfiles.lst
totalsize=0
div=1073741824
for zipfiles in `cat /u01/patches/zipfiles.lst`
do
size=`unzip -l $zipfiles | tail -1 | awk '{ print $1 }'`
totalsize=`expr "$size" + "$totalsize"`
done
TS=$(echo "scale=2; $totalsize/$div" |bc)
echo $TS GB is needed to unzip the patches

#ShellScript #Patching #Unzip #ZipFile #Linux #Database #Exadata #RAC #ASM #Oracle

Please do follow me and support me on,

LinkedIn: https://www.linkedin.com/in/mallik034
YouTube: https://www.youtube.com/c/mallik034
Fakebook: https://www.facebook.com/mallik034
Blog: https://mallik034.blogspot.com
twitter: https://twitter.com/mallik034
Instagram: https://www.instagram.com/mallik034
FBPage: https://www.facebook.com/mallik034oracledba
Skype: malluramadurg


Regards,
Mallikarjun Ramadurg
Mobile: +91 9880616848
WhatsApp: +91 9880616848
Email: [email protected]
LinkedIn: https://www.linkedin.com/in/mallik034
YouTube: https://www.youtube.com/c/mallik034
Fakebook: https://www.facebook.com/mallik034
Blog: https://mallik034.blogspot.com
twitter: https://twitter.com/mallik034
Instagram: https://www.instagram.com/mallik034
FBPage: https://www.facebook.com/mallik034oracledba
Skype: malluramadurg