Linux获取httpd线程的总内存

#/bin/bash
echo ''>httpd.txt
SECONDS=0
while [ $SECONDS -le 1800 ]
do
sleep 2
varmem=`ps aux | grep httpd | grep -v grep |awk '{sum+=$6} END {print sum}'`
vardate=`date "+%H:%M:%S"`
echo $varmem ',' $vardate >>httpd.txt
done

 

posted @ 2017-12-19 09:50  wuzhiyi  阅读(397)  评论(0编辑  收藏  举报