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

Logrotating is important

Failing to rotate the logs (remove old logs, while keeping a number of the latest logs) is a sure way to an unstable and erratic functioning Digipeater / iGate. Rotating logs mean that the logfiles are limited to a predefined size. It is important because the 'disk space' is not unlimited, a normal installation on a Linksys WRT54G only has about 6Mb of free space. By rotating logfiles one can have both some amount of logs and avoid problems with low disk space.

BASED on Backfire Brcm47xx installation.

To prepare the system for logrotating you must have the logrotate package and prequisites installed:
(you only have tin install the packages if they are not already there)
The example here is based on a brcm47xx installation.
We use putty.exe to access the router, find it with google.
The protocol is ssh port 22 and the ip is (unless you've changed it)

user: root
passwd: (whatever you have set it to)
cd /tmp
wget http://downloads.openwrt.org/backfire/10.03/brcm47xx/packages/logrotate_3.7.8-1_brcm47xx.ipk
wget http://downloads.openwrt.org/backfire/10.03/brcm47xx/packages/libpopt_1.7-5_brcm47xx.ipk 
opkg install logrotate_3.7.8-1_brcm47xx.ipk libpopt_1.7-5_brcm47xx.ipk
rm logrotate_3.7.8-1_brcm47xx.ipk
rm libpopt_1.7-5_brcm47xx.ipk
cd /etc/logrotate.d
nano aprx.conf

That will open an editor (quite easy to use), in that you shall enter the following lines:

/var/log/aprx/aprx-rf.log {
        rotate 2
        size 1M
        olddir /var/log/aprx
#       compress
/var/log/aprx/aprx.log {
        rotate 1
        size 10000
        olddir /var/log/aprx
#       compress

Press 'CTRL-X' and 'Y' to save.
Remember NOT to change the log filenames in the /etc/aprx.conf or else this offcause won't function.
You can choose to compress, but for my own purpose I choose not to, I want to make the logs available online... Check the page about "Live Logs".

Then at the prompt type:

crontab -e

you wil now get an editor window (the editor is 'vi')
enter the following line: ( and are the keys!)

33 * * * * logrotate /etc/logrotate.d/aprx.conf > /tmp/crontab


The file is now saved!
That will run the logrotate program every 60th minute at xx:33.