Script to execute a shell script/command when a directory size is large than value.

Medical Technology, Healthcare & Government IT

Category Groups

Created a script for clearing Drupal cache to reduce MySQL database Size. When database size is large than 800MB it will execute the page cache_clear.php for clearing cache.

du -hs /var/lib/mysql/alim | grep ^[8-9][0-9][0-9.]*M
#u -hs /var/lib/mysql | grep ^[4-9][0-9.]*M
if [ $? -eq 0 ]; then
echo "The size exeeds....!!!! Clearing drupal cache....!!!"
cd /usr/share/nginx/www/
/usr/bin/php cache_clear.php
echo "Normal"

celebrex buy online, dapoxetine without prescription

Original Link