mragg
asked on
Dynamically tail a log an outputing to an updated html page
Can anyone tell me how to dynamically "tail" a file an output it an updating html page in unix. I was thinking of using a meta refresh or maybe some javascript but can remember how to do it.
Thanks
Thanks
To refresh an HTML page it's easier to use a meta-tag like this :
<Meta Http-equiv="Refresh" Content="30">
This will refresh every 30 seconds.
<Meta Http-equiv="Refresh" Content="30">
This will refresh every 30 seconds.
ASKER
The part that I really needed to know was if the web page could do the tail - like if there was a java script that could tail the file. I dont want to have a script that is constantly running. It is for a logfile.
The javascript portion was also what I wanted to know so I will award binkzz if no one else answer soon
The javascript portion was also what I wanted to know so I will award binkzz if no one else answer soon
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I thought so, but just checking.
Thanks
Thanks
<body onload=setrefresh();>
<script language=javascript>
function setrefresh()
{
setTimeout ('document.history.go(0)',
}
</script>
That will force it to refresh every minute.
I'm not sure what you want to update the html page with, but say you have a script that allows single log entries into STDIN and uses them to update the html page. You can then easily use a command like:
tail -f /usr/local/apache/logs/err
Which should accomplish what you want it to.
Tom.