Very cool, that was something on my list as well. I quick and dirty tried to imlement the logtail from @illnesse from this thread (Hacking BasicUI: My current Theme / OH2 Setup *Update with Repo*) and copied & modified his script and html, but unfortunately had some issues with the html accessing the data from the log. As I just had a few minutes time, I left it then.
I will copy your one and if I have the time try to make a structured html page. Well hopefully some timeā¦
2019-10-18 20:07:58.492 [ERROR] [hab.binding.exec.handler.ExecHandler] - An exception occurred while executing '/etc/openhab2/kommandon/ev.sh' : 'Cannot run program "/etc/openhab2/kommandon/ev.sh": error=2, No such file or directory'
running by console results same sudo: unable to execute /etc/openhab2/kommandon/ev.sh: No such file or directory
but file exist [20:12:04] openhabian@openHABianPi:~$ dir /etc/openhab2/kommandon/ ev.sh
[20:53:04] openhabian@openHABianPi:~$ cd /etc/openhab2/kommandon
[20:53:30] openhabian@openHABianPi:/etc/openhab2/kommandon$ sudo chmod 774 ev.sh
[20:53:46] openhabian@openHABianPi:/etc/openhab2/kommandon$ sudo ./ev.sh
: No such file or directory
why does it not refresh every minute ?
If I call the script from the console the events.html gets updatet but not automatically by refresh time defined in the thing.
Br Peter
Maybe you run it within a rule by using executeCommandLine or use the Exec Binding with an item. The first has the advantage that you can use a cronjob which replaces every minute, every 10 minutes or every ten hours and so on the HTML file. But nearly the same as your example Thing. With items I mean you can create a Switch and when it goes to on the Exec Binding runs the command and every time you change the state to on the HTML file gets overwritten.
We can see that it`s completely the same as your solution. One advantage in my case is that I can use it multiple times for different logs or terminal outputs without thinking how should I create the HTML. An advantage from your solution is of course that you can use different styles or maybe stylesheets.
Iām just saying. In case of multiple use, a one-liner is certainly not the worst alternative. (And of course there are many other alternatives than ansi2html. And you could also use tools like pdf to html and so on. In some cloud solutions you can download a list as pdf.)
In my example the terminal output is coloured because I used the -t parameter. And ansi2html would create a black background because you know the terminal is configured black.