Laptops :: Battery capacity logger



I was exploring through the fascinating filesystem of Linux and then I found /proc/acpi/battery/MBAT/
There can be found current battery capacity among other stuff in a text file named state.

So I thought about learning a bit of scripting and now I have a crontab running a script which logs current battery capacity every minute with clock time.

Grab it from there if you wish to:
http://cygserv.cygnnet.jkl.fi/thenuke/batlog

If you happen to ask what could be done with this.
I'm going to try to draw some graphs with some spreadsheet software outta the data I gather.

"Crontab is a program that allows users to create jobs that will run at a given time."

Crontab is not installed on DSL by default, I used apt-get install cron to get that.
Because I do not like vi-editor I command EDITOR=nano followed by crontab -e which then opens my favourite editor nano.
On the first empty line I write * * * * * /home/thenuke/batlog
That then runs batlog-script every minute. Check man crontab for more info on that if you wish.

p.s. This was like my first linux script and contribution to these forums, I am sure that one could do the same with one line of code but I'm not the one yet ;-)

join the irc.freenode.net & #damnsmalllinux

mmmmmmmmmmm, you don't mind if i steal your idea and try to make a nice graphical battery monitor do you?
I thought crontab was there by default in /etc/crontab

Brian
AwPhuch

I can't seem to grab it from the above link.
I'm running 0.8.3, and there is a similar file in /proc/apm.
And I cannot access the site to download the script either, so could you post the code in this thread?

Next Page...
original here.