Skip to main content

Thread: memory logging


hi,

i've written small script log memory usage /proc statm

while [ 1=1 ]

date -r >> $2
cat /proc/$1/statm >> $2
'sleep' ls
done
where $1 pid of process & $2 file logs to.

output

tue, 28 jul 2009 08:01:35 +0000
3279 1282 851 1806 0 773 0
....
....
....
how can side side in

tue, 28 jul 2009 08:01:35 +0000 3279 1282 851 1806 0 773 0
or better excluding fields date

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

Popular posts from this blog

Thread: PKI Client 5.00 install (for eToken Pro)

ATmega2560-Arduino Pin Mapping

Crossfader Arduino Tutorial