<div dir="ltr">Your solution will work, of course, only on a tidy shutdown. For unplanned shutdown (aka - power failure) it will not work.<br><br>Ez<br><br><div class="gmail_quote">On Tue, Feb 1, 2011 at 10:18 AM, Omer Zak <span dir="ltr"><<a href="mailto:w1@zak.co.il">w1@zak.co.il</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div><div></div><div class="h5">On Tue, 2011-02-01 at 10:00 +0200, Tom Rosenfeld wrote:<br>
> Hi Guys,<br>
><br>
> Is there a tool that will show me the total uptime (availability) of a<br>
> machine between reboots?<br>
> That is, if the machine was up for 24 hours and then shutdown for an<br>
> hour and then up for 23 hours I want an answer of 47.<br>
><br>
> I need this for charge-back of departments using cloud computer which<br>
> they sometimes turn off.<br>
<br>
</div></div>1. Maybe the cloud computers' provider has the appropriate tool?<br>
In this case, if you don't find the tool yourself, you'll have to tell<br>
us which cloud provider are you working with.<br>
<br>
2. The 'uptime' command gives the uptime since last reboot. You may<br>
want to add 'uptime >> /var/log/my_uptimes_log.txt' to the shutdown<br>
script, and rotate & process, using a custom Perl script,<br>
the /var/log/my_uptime_log.txt file each month to total the uptime in<br>
that month.<br>
<br>
--- Omer<br>
<font color="#888888"><br>
<br>
--<br>
MCSE - acronym for Minesweeper Consultant & Solitaire Expert. (Unknown)<br>
My own blog is at <a href="http://www.zak.co.il/tddpirate/" target="_blank">http://www.zak.co.il/tddpirate/</a><br>
<br>
My opinions, as expressed in this E-mail message, are mine alone.<br>
They do not represent the official policy of any organization with which<br>
I may be affiliated in any way.<br>
WARNING TO SPAMMERS: at <a href="http://www.zak.co.il/spamwarning.html" target="_blank">http://www.zak.co.il/spamwarning.html</a><br>
</font><div><div></div><div class="h5"><br>
<br>
_______________________________________________<br>
Linux-il mailing list<br>
<a href="mailto:Linux-il@cs.huji.ac.il">Linux-il@cs.huji.ac.il</a><br>
<a href="http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il" target="_blank">http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il</a><br>
</div></div></blockquote></div><br></div>