Mailing List Archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [tlug] Uptime to web site



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Tue, Aug 20, 2002 at 02:40:20PM +0900, Eric O. Flores wrote:
> 
> I tried you script but there is something confusing with it!!!?? it
> generates no output!

Im not sure what you mean by that, but crontab will complain about
having it on multiple lines. Put it in one line like this to have it
update once a day, at 15:45:

45 15 * * *     echo "<html><head></head><body> `uptime | awk '{ print $3" days" }'` </body></html>" > /home/mydir/uptime.html

> It seems that a direct uptime command in a shell works fine updating the
> time to a blank page uptime.html 
> 
> "uptime > /home/mydir/uptime.html"  

That will just put the plain text result in 'uptime.html', without the
tags.

> The end result looks like:
> 
> 2:31pm up 1 day, 3:07, 1 user, load average: 0.00, 0.02, 0.05

If you want the whole line, just remove the
 | awk '{ print $3" days" }'
part in the above command. I put that in to just get the days.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE9YeaBt1KjqyZ+DQ4RAr8cAJ9bqPjkbXe+OQ3b9QAGv63oGTQDvACfbB45
H0rD59nP4hLNHhdjw8QKZ78=
=Vekk
-----END PGP SIGNATURE-----


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links