Welcome to KissOZ.dk - Radio TNC, Tracker and more

Serving Live logs from Aprx

First we will create the location for the scripts and put the scripts there, here we go:

As with logrotate we use putty.exe to access the router, find it with google.
The protocol is ssh port 22 and the ip is 192.168.1.1 (unless you changed it)

user: root
passwd: (whatever you entered in the admins webpage).

cd /www
mkdir aprx
ln -s /var/log/aprx /www/aprxlog
cd aprx
wget http://www.kissoz.dk/aprx/logserver/genindex.sh

wget http://www.kissoz.dk/aprx/logserver/tac.sh

This created a directory in the webserver path and a symbolic link to the location of the logfiles, the logfiles disappear when the router is restarted as they reside in a memory disk.
Last imported the script that generates the public webpage. (not very fancy, but efficient)
Next get the script that converts the log content, so it can be displayed on a web page:

wget  http://vgoenka.tripod.com/unixscripts/text2html.awk.txt
mv text2html.awk.txt text2html.sh
chmod 755 text2html.sh
chmod 755 genindex.sh
chmod 755 tac.sh
wget http://www.kissoz.dk/aprx/logserver/index_head.txt
wget http://www.kissoz.dk/aprx/logserver/index_end.txt
wget http://www.kissoz.dk/aprx/logserver/index.html

Now we are almost ready.... all we have to do is to edit the cron job to include an extra line:


crontab -e
press INS
* * * * * /www/aprx/genindex.sh
press ESC
press :wq

That should be it....
test the script while we are here enter:


./genindex.sh

Now load the webpage: http://192.168.1.1/aprx: Example page
Did you also prepare logrotate? if not it is very important that you do see the logrotate page
If you already did, there is a little bonus check: http://192.168.1.1/aprxlog, here you will find the logs stored for download.

Updated to show logpage with latest input first (reverse) and some mistakes in genindex.sh are fixed (thanks OZ1BZJ)