Ths a script to prevent reaching the disk limit and the data base corruption:

 

#alertsize.sh
*/5 * * * * date >> /tmp/mylog ; $HOME/alertsize.sh >> /tmp/mylog

 

 

>cat alertsize.sh

#! /bin/sh
#sizedisk=`du -sh`
sizedisk=`du | tail -1 | awk '{print $ 1}'`
echo "The used size of the disk is: $sizedisk"
if [ $sizedisk -gt 9215390 ]
# if the account disk occupation is greater than 9G
then
$HOME/slev5/bin/stopslev5
echo "stopping the SLEV5, preventing the crash"
fi
echo "--------------------------------------"