[svlug] need an uptime birthday script

Robert Hajime Lanning lanning at lanning.cc
Fri Jun 19 13:44:31 PDT 2009


Daevid Vincent wrote:
> I'm about to celebrate a 1 yr uptime here and it got me thinking... 
> 
> root at pse02:~# uptime
>  20:10:01 up 364 days, 23:20,  6 users,  load average: 1.02, 1.01, 1.00
> 
> root at pse02:~# echo 'echo "`/usr/bin/uptime`" | mail -s "Happy 1 Year Uptime
> on PSE02!!" theteam at work.com' | at 20:49
> 
> Anyone have or know of a script that I can run on my servers that will email
> me at intervals, maybe 6 months or 1 year uptime birthdays? I know it's
> cheeky, but it also let's us (and management know that our servers are solid
> and something to be proud of the lack of reboots)
> 
> The hard part is finding the delta and doing the "time math" from the system
> current time and the actual uptime of course.

You could run a script once a day, that parses out the "days" field 
(when it is there,) and emails when divisible by 365.

That would be the easiest.

-- 
END OF LINE
       --MCP




More information about the svlug mailing list