OpenWrt Forum Archive

Topic: how to change vnstat output directory?

The content of this topic has been archived on 24 Mar 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

How can I change vnstat output dir "/var/lib/vnstat" to something else?

I already tried to modify the

"LIB_D=/var/lib/vnstat"

dir in the

"/etc/init.d/vnstat"

file but it didn't helped.

The problem is why I want to change the folder is that when I reboot the router the "/var/lib/vnstat" disappears, because "/var" is a directory to /tmp/.
And that's a problem sad , because I will loose alll my traffic statistics when a reboot comes... sad

I use OpenWrt Kamikaze 8.09

Thank you

I'd try extracting the vnstat.conf from http://humdi.net/vnstat/vnstat-1.6.tar.gz to <OpenWrt>/etc/vnstat.conf and changing the DatabaseDir config option.

The init script is only used to download a vnstat backup database from a http server.

The discussion might have continued from here.