[svlug] need an uptime birthday script

Lisa svlug at flygirl.com
Fri Jun 19 16:23:21 PDT 2009


On Fri, Jun 19, 2009 at 04:08:06PM -0700, Daevid Vincent wrote:
> Oh no! I just had a horrible epiphany. If I reboot one of the servers, then
> I still have an "at" entry and my uptime has now changed -- a double whammy.
> Ratz! Looks like back to the drawing board and I'll have to use a crontab
> and parse the uptime every minute every day doing the '365' trick as
> previously mentioned. Ugh... I'm spending too much time on this aren't I?
> Someone stop me!

Running something like this should work (not sure how you'd put
it in a startup).  And it would have the advantage of notifying
you at the right time, to the second (or whatever resolution
sleep uses).  I've NO idea, though, how much load "sleep" causes
(IIRC, it isn't much)

sleep $(expr $(( 60 * 60 * 24 * 365 )) - $(cut -d. -f1 < /proc/uptime)) ; /usr/bin/uptime | mail -s "One year uptime" user at localhost





More information about the svlug mailing list