linux下磁盘报警脚本

#!/bin/bash
ip='10.0.101.96'
time=`date +%F-%H:%M`
tmpfile=/tmp/disk.txt
mail_address=`[email protected]`
cipan=`df -h |awk '{print $5}' |sed  's/%//g' | sed -n 5p`
touch  /tmp/disk.txt
echo "From :$ip" > $tmpfile
echo "Date time:$time" >> $tmpfile
echo "df :$cipan" >> $tmpfile
if [ $cipan -gt 6 ] ;
then
echo $cipan
fi

你可能感兴趣的:(linux,touch)