9

Writing CPU usage by core and RAM/CPU usage by process to a logfile in OS X

view full story
linux-howto

http://superuser.com – I am writing a script that writes memory and CPU usage to a log file, every hour on a cronjob. The logfile will look something like this: "/n====CPU usage by core====" Core0: 59.05% used Core1: 57.68% used "/n====RAM/CPU usage by process====" PID | RAM used (KB) | %CPU used | COMM | USER 01 | 00003352 | 0.15% | /sbin/launchd | root 11 | 00009220 | 0.65% | /usr/libexec/Use | root 12 | 00005504 | 7.81% | /usr/libexec/kex | root It will most likely use one command for CPU usage by core and another command for RAM/CPU usage by process, but I could use one com (HowTos)