Hi everyone, I'm new on using OpenWrt, I choose this system as I think it can monitor the internet usage. I want to know hom many giga I use every mouth.
I tried vnstat and nlbwmon, they work well, but each time the router is rebooting, datas are cleared. Can anyone help me to fix this?
BTW, there is no usb port for external data storage
Sorry for my bad english
miasarija:
datas are cleared. Can anyone help me to fix this?
BTW, there is no usb port for external data storage
You just answered your own question.
1 Like
But I'd like to know if it works if it stored in the router's storage, and how to do it.
You can change the location where it's stored, but it might kill your flash down the road, due to excessive writing.
2 Likes
which location on openwrt is persistent where I can save the db file?
it'd be in /overlay, I guess
This works for me. I've added this small tar
step to network init to save vnstats and collectd data
on gracefull reboot.
/etc/init.d/network
start_service() {
(...)
procd_close_instance
+ tar xzf /etc/rrd.tar.gz -C /
}
(...)
shutdown() {
+ tar czf /etc/rrd.tar.gz /tmp/rrd /tmp/lib/vnstat/vnstat.db
ifdown -a
sleep 1
}
and crontab monthly (might be often for you)
root@homehub5a:~# crontab -l
9 0 1 * * tar czf /etc/rrd.tar.gz /tmp/rrd /tmp/lib/vnstat/vnstat.db
also added /etc/rrd.tar.gz
to /etc/sysupgrade.conf
to survive sysupgrade
2 Likes
I'll try /overlay and give feeback later
Hi, I tried /overlay partition and it works well now, even after reboot. Thanks a lot