#!/bin/sh
Page=`df -h | grep /var | awk '{print $5}'| awk -F "%" '{print $1}'`
Mark=60
if [ "$Page" -ge "$Mark" ]
then
#echo $Page
find /var/log/httpd/ -type f -ctime +60 -exec rm {} \;
fi
参考例子:
[root@cecos ~]# awk -F "/" ' BEGIN{ FS="\\"}/mysql/{ print $1"\\"$3}' test.txt
mysql:x:27:27:MySQL Server:/var/lib/mysql:/bin/bash\
---过滤加输出分隔符
[root@cecos ~]# awk -F "/" '{print $1}' test.txt ----改变分隔符“/”默认是空格