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 that
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
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.