Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make script twice as efficient :) #5

Open
samwyse opened this issue Aug 18, 2013 · 3 comments
Open

make script twice as efficient :) #5

samwyse opened this issue Aug 18, 2013 · 3 comments

Comments

@samwyse
Copy link

samwyse commented Aug 18, 2013

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

@jakl
Copy link

jakl commented Aug 18, 2013

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
Copy link

va3paw commented Dec 13, 2013

Now with the temperature data collection

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

@pronoiac
Copy link

pronoiac commented Aug 9, 2014

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants