# desc :get process meminfo every xxx seconds. # author :lidp #!/bin/sh pid=1036 # pid = `ps|grep xxxx |awk 'NR==1 {print $1}'` echo $pid # get meminfo every 3 seconds interval=3 while true do DATE=`date +%H:%M:%S-%Y-%m-%d` echo $DATE >> proc_memlog.txt cat /proc/$pid/status|grep -e VmRSS >> proc_memlog.txt echo $blank >> proc_memlog.txt sleep $interval done
linux 统计指定进程内存使用情况到文件 脚本
最新推荐文章于 2022-08-04 22:40:27 发布