Thread: memory logging
hi,
i've written small script log memory usage /proc statm
where $1 pid of process & $2 file logs to.while [ 1=1 ]
date -r >> $2
cat /proc/$1/statm >> $2
'sleep' ls
done
output
how can side side intue, 28 jul 2009 08:01:35 +0000
3279 1282 851 1806 0 773 0
....
....
....
or better excluding fields datetue, 28 jul 2009 08:01:35 +0000 3279 1282 851 1806 0 773 0
tue, 28 jul 08:01:35 3279 1282 851 1806 0 773 0
ideas???
cheers
david
hi
use variables, follows:
d=$(date -r)
m=$(cat /proc/$1/statm)
echo "$d $m" >> $2
change format of date, see
man date
date +"%a %d %b %y %t" want think
Forum The Ubuntu Forum Community Ubuntu Official Flavours Support General Help [ubuntu] memory logging
Ubuntu
Comments
Post a Comment