cpu, mem, ps output to file script
howdy folks,
I wrote a small script that takes the output from several normal linux commands and writes them to a unique filename. What do you think? #!/bin/bash # simple script to output various stats into unique file log # Lord Beeblequix 09/08/2006 # yes, the name is inspired by Counterstrike uniquedate=`date +%m%d%Y%H%M` statfile="$HOME/stats_${uniquedate}.log" # ********************************* # snapshot of cpu cycles using top # ********************************* echo "Running 2x iterations of top" top -b -n2 -C > $statfile echo # ********************************* # snapshot of all running processes # ********************************* echo "ps in BSD format." ps -aux >> $statfile echo # ********************************* # snapshot of memory usage # ********************************* echo "Memory stats in MB from free -m" free -m >> $statfile echo echo "Now, go get a bearclaw." |
__________________________________________
|
I think it's super :D
Why don`t ya add some disk info like: Code:
echo "----- Top 5 File Systems by Percentage " |
good idea. thanks.
|
All times are GMT -5. The time now is 04:20 PM. |