Search Members Help

» Welcome Guest
[ Log In :: Register ]

Mini-ITX Boards Sale, Fanless BareBones Mini-ITX, Bootable 1G DSL USBs, 533MHz Fanless PC <-- SALE $200 each!
Get The Official Damn Small Linux Book. DSL Market , Great VPS hosting provided by Tektonic
 

[ Track this topic :: Email this topic :: Print this topic ]

reply to topic new topic new poll
Topic: Battery capacity logger, I made a little script.< Next Oldest | Next Newest >
thenuke Offline





Group: Members
Posts: 3
Joined: Nov. 2004
Posted: Nov. 15 2004,06:01 QUOTE

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
Back to top
Profile PM 
ico2 Offline





Group: Members
Posts: 802
Joined: July 2004
Posted: Nov. 24 2004,17:18 QUOTE

mmmmmmmmmmm, you don't mind if i steal your idea and try to make a nice graphical battery monitor do you?

--------------
ico2
Back to top
Profile PM MSN 
AwPhuch Offline





Group: Members
Posts: 1404
Joined: April 2004
Posted: Nov. 24 2004,21:17 QUOTE

I thought crontab was there by default in /etc/crontab

Brian
AwPhuch


--------------
http://www.frappr.com/dsl <-- Where do you use DSL?
http://www.smoothwall.org <-- Ultimate firewall for the world!
http://boinc.mundayweb.com/one/stats.php/userID:6107 <--My BOINC stats!
./S99LinuxRevolution start
Back to top
Profile PM WEB 
caulktel Offline





Group: Members
Posts: 185
Joined: Sep. 2003
Posted: Nov. 24 2004,21:19 QUOTE

I can't seem to grab it from the above link.

--------------
Joel
KB6QVI
Back to top
Profile PM 
Toasted Pentiums Offline





Group: Members
Posts: 3
Joined: Nov. 2004
Posted: Nov. 24 2004,21:44 QUOTE

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?
Back to top
Profile PM 
4 replies since Nov. 15 2004,06:01 < Next Oldest | Next Newest >

[ Track this topic :: Email this topic :: Print this topic ]

 
reply to topic new topic new poll
Quick Reply: Battery capacity logger

Do you wish to enable your signature for this post?
Do you wish to enable emoticons for this post?
Track this topic
View All Emoticons
View iB Code