开发者

awk shell script help

开发者 https://www.devze.com 2023-01-08 02:33 出处:网络
i have the output ofcat /proc/loadavg and /proc/meminfo MemFree:1191220 kB i need a to know who will i get a script to get then added in a logfile every 5 mins.

i have the output of cat /proc/loadavg and /proc/meminfo MemFree: 1191220 kB

i need a to know who will i get a script to get then added in a logfile every 5 mins.

eg: CPU; Mem;

10.0;   1191220

and so on so the next entry will be below th开发者_如何学编程at

eg: CPU; Mem

10.0;      1191220
5.0;        2229882

Thanks in advance


First you will need to write a shell script which execute loadavg and meminfo and add there output into your desired log file. Now you can get this script repeatedly executed by cron by setting up a cron task. To setup cron task you will need to add entry into /etc/crontab. For details you can consult man entries for cron and crontab.

Also I think this questions is more suited to serverfault.com

0

精彩评论

暂无评论...
验证码 换一张
取 消