[NBLUG/talk] top

Scott Doty scott at sonic.net
Wed Dec 15 10:46:15 PST 2004


On Wed, Dec 15, 2004 at 10:41:41AM -0800, sms at sonic.net wrote:
> > 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

You can also run top in "batch" mode with -b -- this produces dumb terminal
output.

 -Scott




More information about the talk mailing list