Hello ! I recently installed luci-app-statistics etc and it's working fine. Now, according to the documentation, the rrd files are saved under tmp, and are doomed to vanish upon rebooting of the router. The standard way to get around is to put a USB stick on the router and save them there. But my OpenWRT is Raspberry pi 4 with 32 GB SD card, I think I should be able to save the rrd files somewhere in SD card without making OpenWRT stop working. But I am not sure where the right place is. On my disk-utility, I see a partition "boot", and "linux", and I figure that "boot" is where OpenWRT lives. But I have
bin dev lib mnt proc root sys usr www
boot etc lib64 overlay rom sbin tmp var
and they seem to be all there for OpenWRT, not just boot.
I would very much appreciate if someone could tell me where the right/safe place is.
I also have another Raspi 4 ("Raspi-Unifi"), where I run Unifi Controller. I installed "samba" there and tried to see if I could save the files there, but didn't manage to figure out....
I would like to be able to see the statistics for a year or so.
Thank you very much for your information and advice, both of you ! I had very little idea about these directories, I was always wondering why certain files are usually in certain directories.
Now in practice, what @hnyman suggests sounds good to me. Since my OpenWRT is on SD card, I should avoid writing things very often. I am also interested in general trend (of bandwidth usage) and don't mind losing data for some time, having a back up once a day is enough. I looked at the other page and just did what you prescribed Pretty nice Now, one question: am I right that
storeStats.sh is taken care of by cron, but you execute restoreStats.sh manually whenever you rebooted the router ? (thus the graphs will appear as usual, only with a gap of several hours between the last backup and the reboot) Can it be set to be executed upon boot ?
Now I see, someone else @ user674574 modified your script so that it will restore the data automatically upon booting.... I already set up everything using your scripts and am feeling lazy to change much.... I'm not going to reboot the router so often (actually almost never... should I reboot it regularly?) so for now I'm just going to remember to execute restoreStats.sh.
I think I would like cron to sftp or scp the backup files to my other Raspi (with Unifi Controller) once a month. Can cron do something which requires login name and password ? (or rather, can a .sh file do something like this ?)
That has been enough for me.
(And usually I manually store that stats before sysupgrades, so that I lose as little as possible)
Feel free to modify those for your needs, e.g. the autoload at startup. I build so often and test various things , that I have not looked into that (as want to keep the automatic boot near the defaults).