%PDF- %PDF-
Direktori : /scripts2/ |
Current File : //scripts2/find_inodes.sh |
limitante=250000 fechaayer=$(/bin/date -d 'now -24 hours' +"%Y-%m-%d") fechahoy=$(/bin/date -d 'now' +"%Y-%m-%d") /bin/echo " 0 " > /root/salida.inodes.txt /bin/echo " 0 =====================" >> /root/salida.inodes.txt /bin/echo " 0 Buscando inodos en /home/usuario/mail/" >> /root/salida.inodes.txt /bin/echo " 0 =====================" >> /root/salida.inodes.txt du --inodes --max-depth=1 /home/*/mail/*/ | sort -rn | head -n 10 >> /root/salida.inodes.txt /bin/echo " 0 " >> /root/salida.inodes.txt /bin/echo " 0 ===============================" >> /root/salida.inodes.txt /bin/echo " 0 Buscando inodos en /home/usuario/public_html" >> /root/salida.inodes.txt /bin/echo " 0 ===============================" >> /root/salida.inodes.txt du --inodes --max-depth=1 /home/*/public_html/*/ | sort -rn | head -n 10 >> /root/salida.inodes.txt /bin/echo " 0 " >> /root/salida.inodes.txt /bin/echo " 0 =========================" >> /root/salida.inodes.txt total_lines=$(wc -l < /root/salida.inodes.txt) while read -r line; do count=$(echo $line | cut -f1 -d " "); if [ $count -gt $limitante ] then mensaje=$(cat /root/salida.inodes.txt) echo -e "$mensaje" > /root/mensaje.txt mensajefinal=$(cat /root/mensaje.txt) /bin/mail -s "Reporte de Inodes en $HOSTNAME" sysadmin@sitioshispanos.com <<< "$mensajefinal" break fi done < /root/salida.inodes.txt;