jradavenport / batlog

1 Year of MacBook Air Battery Logs
BSD 2-Clause "Simplified" License
189 stars 35 forks source link

make script twice as efficient :) #5

Open samwyse opened 11 years ago

samwyse commented 11 years ago

date >> ~/batlog.dat /usr/sbin/ioreg -l | egrep 'CycleCount|Capacity' >> ~/batlog.dat

jakl commented 11 years ago

Make sure to use -rk BatterySerialNumber

time ioreg -l > /dev/null

real 0m1.415s user 0m0.155s sys 0m1.258s

time ioreg -rk BatterySerialNumber > /dev/null

real 0m0.013s user 0m0.003s sys 0m0.010s

va3paw commented 10 years ago

Now with the temperature data collection

date >> ~/batlog.dat /usr/sbin/ioreg -l | egrep 'Capacity|Temperature' >> ~/batlog.dat

pronoiac commented 10 years ago

You dropped CycleCount, va3paw. I added that and some charging info: (date; /usr/sbin/ioreg -l | egrep "CycleCount|Capacity|Temperature|Charg" ) >> ~/batlog.dat

Caveat: I haven't checked whatever parses the logs into csv. Incidentally, specifying the full filepath might be a good idea. Maybe we should have a helper script for that, I don't know.