[NBLUG/talk] top
sms at sonic.net
sms at sonic.net
Wed Dec 15 10:41:41 PST 2004
> Anybody know if there is a way to log top information or similar
> information. I'm interested in a couple of processes and their CPU usage
> over about a half hour time period. I'd also like the overall system
> usage over the period. I can probably watch it manually most nights,
> but I'd like to know whether I'm there or not.
Is there any reason you don't want to use a simple script? E.g.
touch topper
date >> topper
echo " " >> topper
while (whatever-condition-suits-your-need)
do
top n 1 >> topper
echo "=======================================================" >> topper
sleep 30 # That's a snapshot every 30 seconds; change as needed
done
Note that "top" is relatively cpu-intensive; you might use "ps | grep",
maybe with "uptime" or something similar; yes, "top" gives more info, but
it rather sounds like overkill for your needs.
- Steve S.
More information about the talk
mailing list