Mit0s1s Posted October 29, 2013 Posted October 29, 2013 I want to test a battery I have to see how long the MKV will run. What log file would I look in to see time stamps, or an up time register? Quote
Mit0s1s Posted October 29, 2013 Author Posted October 29, 2013 is "uptime" a log file? if so where is it located? Quote
Sebkinne Posted October 29, 2013 Posted October 29, 2013 It is a linux command. Every linux box has it. Or almost any anyway. Quote
Mit0s1s Posted October 29, 2013 Author Posted October 29, 2013 Thanks seb, learned something tonight. Quote
thesugarat Posted October 29, 2013 Posted October 29, 2013 (edited) I'm curious what that would look like... Maybe something like this? cat uptime > /usr/tmp/logfilename.log I've got a battery I'd like to benchmark under heavy load with the Mk5 also. Edited October 29, 2013 by thesugarat Quote
jjd Posted October 29, 2013 Posted October 29, 2013 (edited) if your wanting to just leave the pineapple running and see when it turns off maybe set a cron job to run every 15 minutes or so and have it save uptime to a file. that would be the least resource heavy way I think uptime > uptime.log or if you want to tax the system just a bit and use a little processor power you could do a loop in a .sh script and it will add teh uptime to the log every 60 seconds while true do uptime > uptime.log sleep 60 done or if you want to use a lot more processor power as if the mk5 was under load in the field you could have the system calculate pi between logging uptime first install bc opkg update opkg install bc to calculate pi and log uptime on the mk5 add this to a .sh script. this should create a new log entry every 8 minutes or so as it will calculate pi to 5000 digits between every log update. while true do uptime > uptime.log echo "scale=5000; 4*a(1)" | bc -l done and just for the hell of it if you want to know how the mk5 speed compares to a pc the mk5 should take about 8 minutes to calculate pi to 5000 digits my i7 macbook does it in 16.980 seconds, really not bad at all! Edited October 29, 2013 by jjd Quote
Mit0s1s Posted October 29, 2013 Author Posted October 29, 2013 i was trying something like this uptime >> logfilename.txt had no luck, couldn't get it to write a file, tried thesugarat's version and no luck either. Quote
jjd Posted October 29, 2013 Posted October 29, 2013 i was trying something like this uptime >> logfilename.txt had no luck, couldn't get it to write a file, tried thesugarat's version and no luck either. works for me root@Pineapple:~# uptime > uptime.log root@Pineapple:~# ls uptime.log root@Pineapple:~# cat uptime.log 06:22:01 up 27 min, load average: 0.00, 0.13, 0.31 root@Pineapple:~# Quote
Mit0s1s Posted October 29, 2013 Author Posted October 29, 2013 got it going, logging away. Lets see what this battery can do, thanks jjd Quote
jjd Posted October 29, 2013 Posted October 29, 2013 (edited) got it going, logging away. Lets see what this battery can do, thanks jjd not a problem! I should also mention if your don't have an sd card in u may want to use longer times to log or save the log to an sd card if using >> as it will append to the file > will overwrite the file so it will not get larger. no idea how large the file will get but it would suck to use up all the free space and have to start all over again. that would just be a waste of pineapple juice. Edited October 29, 2013 by jjd Quote
thesugarat Posted October 29, 2013 Posted October 29, 2013 Thanks jjd, I'll give that a shot later this evening. I guess I was thinking that uptime was already running when I started off with cat... Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.