Database "vnstat2" is gone

Second time mysteriously the entire vnstat database is gone.
I'm using vnstati2 luci-app-vnstat2.

Screenshot from 2023-03-29 12-48-37

System Log

Wed Mar 22 19:03:57 2023 user.notice firewall: Reloading firewall due to ifup of wan (wan)
Wed Mar 29 10:44:28 2023 daemon.info dnsmasq[1]: exiting on receipt of SIGTERM
Wed Mar 29 10:44:28 2023 daemon.info dnsmasq[1]: started, version 2.86 cachesize 150
Wed Mar 29 10:44:28 2023 daemon.info dnsmasq[1]: DNS service limited to local subnets
Wed Mar 29 10:44:28 2023 daemon.info dnsmasq[1]: compile time options: IPv6 GNU-getopt no-DBus UBus no-i18n no-IDN DHCP no-DHCPv6 no-Lua TFTP no-conntrack no-ipset no-auth no-cryptohash no-DNSSEC no-ID loop-detect inotify dumpfile
Wed Mar 29 10:44:28 2023 daemon.info dnsmasq[1]: UBus support enabled: connected to system bus
Wed Mar 29 10:44:28 2023 daemon.info dnsmasq-dhcp[1]: DHCP, IP range 192.168.1.100 -- 192.168.1.249, lease time 12h
Wed Mar 29 10:44:28 2023 daemon.info dnsmasq[1]: using only locally-known addresses for test
Wed Mar 29 10:44:28 2023 daemon.info dnsmasq[1]: using only locally-known addresses for onion
Wed Mar 29 10:44:28 2023 daemon.info dnsmasq[1]: using only locally-known addresses for localhost
Wed Mar 29 10:44:28 2023 daemon.info dnsmasq[1]: using only locally-known addresses for local
Wed Mar 29 10:44:28 2023 daemon.info dnsmasq[1]: using only locally-known addresses for invalid
Wed Mar 29 10:44:28 2023 daemon.info dnsmasq[1]: using only locally-known addresses for bind
Wed Mar 29 10:44:28 2023 daemon.info dnsmasq[1]: using only locally-known addresses for lan
Wed Mar 29 10:44:28 2023 daemon.info dnsmasq[1]: reading /tmp/resolv.conf.d/resolv.conf.auto
Wed Mar 29 10:44:28 2023 daemon.info dnsmasq[1]: using nameserver 1.1.1.1#53
Wed Mar 29 10:44:28 2023 daemon.info dnsmasq[1]: using nameserver 1.0.0.1#53
Wed Mar 29 10:44:28 2023 daemon.info dnsmasq[1]: using only locally-known addresses for test
Wed Mar 29 10:44:28 2023 daemon.info dnsmasq[1]: using only locally-known addresses for onion
Wed Mar 29 10:44:28 2023 daemon.info dnsmasq[1]: using only locally-known addresses for localhost
Wed Mar 29 10:44:28 2023 daemon.info dnsmasq[1]: using only locally-known addresses for local
Wed Mar 29 10:44:28 2023 daemon.info dnsmasq[1]: using only locally-known addresses for invalid
Wed Mar 29 10:44:28 2023 daemon.info dnsmasq[1]: using only locally-known addresses for bind
Wed Mar 29 10:44:28 2023 daemon.info dnsmasq[1]: using only locally-known addresses for lan
Wed Mar 29 10:44:28 2023 daemon.info dnsmasq[1]: read /etc/hosts - 4 addresses
Wed Mar 29 10:44:28 2023 daemon.info dnsmasq[1]: read /tmp/hosts/dhcp.cfg01411c - 2 addresses
Wed Mar 29 10:44:28 2023 daemon.info dnsmasq[1]: read /tmp/hosts/odhcpd - 2 addresses
Wed Mar 29 10:44:28 2023 daemon.info dnsmasq-dhcp[1]: read /etc/ethers - 0 addresses
Wed Mar 29 10:44:29 2023 daemon.notice netifd: Interface 'wan6' is now up
Wed Mar 29 10:44:29 2023 daemon.info dnsmasq[1]: reading /tmp/resolv.conf.d/resolv.conf.auto
Wed Mar 29 10:44:29 2023 daemon.info dnsmasq[1]: using nameserver 1.1.1.1#53
Wed Mar 29 10:44:29 2023 daemon.info dnsmasq[1]: using nameserver 1.0.0.1#53
Wed Mar 29 10:44:29 2023 daemon.info dnsmasq[1]: using nameserver 2606:4700:4700::1111#53
Wed Mar 29 10:44:29 2023 daemon.info dnsmasq[1]: using nameserver 2606:4700:4700::1001#53
Wed Mar 29 10:44:29 2023 daemon.info dnsmasq[1]: using only locally-known addresses for test
Wed Mar 29 10:44:29 2023 daemon.info dnsmasq[1]: using only locally-known addresses for onion
Wed Mar 29 10:44:29 2023 daemon.info dnsmasq[1]: using only locally-known addresses for localhost
Wed Mar 29 10:44:29 2023 daemon.info dnsmasq[1]: using only locally-known addresses for local
Wed Mar 29 10:44:29 2023 daemon.info dnsmasq[1]: using only locally-known addresses for invalid
Wed Mar 29 10:44:29 2023 daemon.info dnsmasq[1]: using only locally-known addresses for bind
Wed Mar 29 10:44:29 2023 daemon.info dnsmasq[1]: using only locally-known addresses for lan
Wed Mar 29 10:44:29 2023 daemon.info dnsmasq[1]: read /etc/hosts - 4 addresses
Wed Mar 29 10:44:29 2023 daemon.info dnsmasq[1]: read /tmp/hosts/dhcp.cfg01411c - 2 addresses
Wed Mar 29 10:44:29 2023 daemon.info dnsmasq[1]: read /tmp/hosts/odhcpd - 4 addresses
Wed Mar 29 10:44:29 2023 daemon.info dnsmasq-dhcp[1]: read /etc/ethers - 0 addresses
Wed Mar 29 10:44:29 2023 daemon.info dnsmasq[1]: exiting on receipt of SIGTERM
Wed Mar 29 10:44:29 2023 daemon.info dnsmasq[1]: started, version 2.86 cachesize 150
Wed Mar 29 10:44:29 2023 daemon.info dnsmasq[1]: DNS service limited to local subnets
Wed Mar 29 10:44:29 2023 daemon.info dnsmasq[1]: compile time options: IPv6 GNU-getopt no-DBus UBus no-i18n no-IDN DHCP no-DHCPv6 no-Lua TFTP no-conntrack no-ipset no-auth no-cryptohash no-DNSSEC no-ID loop-detect inotify dumpfile
Wed Mar 29 10:44:29 2023 daemon.info dnsmasq[1]: UBus support enabled: connected to system bus
Wed Mar 29 10:44:29 2023 daemon.info dnsmasq-dhcp[1]: DHCP, IP range 192.168.1.100 -- 192.168.1.249, lease time 12h
Wed Mar 29 10:44:29 2023 daemon.info dnsmasq[1]: using only locally-known addresses for test
Wed Mar 29 10:44:29 2023 daemon.info dnsmasq[1]: using only locally-known addresses for onion
Wed Mar 29 10:44:29 2023 daemon.info dnsmasq[1]: using only locally-known addresses for localhost
Wed Mar 29 10:44:29 2023 daemon.info dnsmasq[1]: using only locally-known addresses for local
Wed Mar 29 10:44:29 2023 daemon.info dnsmasq[1]: using only locally-known addresses for invalid
Wed Mar 29 10:44:29 2023 daemon.info dnsmasq[1]: using only locally-known addresses for bind
Wed Mar 29 10:44:29 2023 daemon.info dnsmasq[1]: using only locally-known addresses for lan
Wed Mar 29 10:44:29 2023 daemon.info dnsmasq[1]: reading /tmp/resolv.conf.d/resolv.conf.auto
Wed Mar 29 10:44:29 2023 daemon.info dnsmasq[1]: using nameserver 1.1.1.1#53
Wed Mar 29 10:44:29 2023 daemon.info dnsmasq[1]: using nameserver 1.0.0.1#53
Wed Mar 29 10:44:29 2023 daemon.info dnsmasq[1]: using nameserver 2606:4700:4700::1111#53
Wed Mar 29 10:44:29 2023 daemon.info dnsmasq[1]: using nameserver 2606:4700:4700::1001#53
Wed Mar 29 10:44:29 2023 daemon.info dnsmasq[1]: using only locally-known addresses for test
Wed Mar 29 10:44:29 2023 daemon.info dnsmasq[1]: using only locally-known addresses for onion
Wed Mar 29 10:44:29 2023 daemon.info dnsmasq[1]: using only locally-known addresses for localhost
Wed Mar 29 10:44:29 2023 daemon.info dnsmasq[1]: using only locally-known addresses for local
Wed Mar 29 10:44:29 2023 daemon.info dnsmasq[1]: using only locally-known addresses for invalid
Wed Mar 29 10:44:29 2023 daemon.info dnsmasq[1]: using only locally-known addresses for bind
Wed Mar 29 10:44:29 2023 daemon.info dnsmasq[1]: using only locally-known addresses for lan
Wed Mar 29 10:44:29 2023 daemon.info dnsmasq[1]: read /etc/hosts - 4 addresses
Wed Mar 29 10:44:29 2023 daemon.info dnsmasq[1]: read /tmp/hosts/dhcp.cfg01411c - 2 addresses
Wed Mar 29 10:44:29 2023 daemon.info dnsmasq[1]: read /tmp/hosts/odhcpd - 4 addresses
Wed Mar 29 10:44:29 2023 daemon.info dnsmasq-dhcp[1]: read /etc/ethers - 0 addresses
Wed Mar 29 10:44:29 2023 user.notice SQM: Stopping SQM on wan
Wed Mar 29 10:44:29 2023 user.notice SQM: ERROR: cmd_wrapper: tc: FAILURE (2): /sbin/tc qdisc del dev wan ingress
Wed Mar 29 10:44:29 2023 user.notice SQM: ERROR: cmd_wrapper: tc: LAST ERROR: Error: Cannot find specified qdisc on specified device.
Wed Mar 29 10:44:29 2023 user.notice SQM: ERROR: cmd_wrapper: tc: FAILURE (2): /sbin/tc qdisc del dev wan root
Wed Mar 29 10:44:29 2023 user.notice SQM: ERROR: cmd_wrapper: tc: LAST ERROR: Error: Cannot delete qdisc with handle of zero.
Wed Mar 29 10:44:29 2023 user.notice SQM: ERROR: cmd_wrapper: tc: FAILURE (2): /sbin/tc qdisc del dev ifb4wan root
Wed Mar 29 10:44:29 2023 user.notice SQM: ERROR: cmd_wrapper: tc: LAST ERROR: Error: Cannot delete qdisc with handle of zero.
Wed Mar 29 10:44:30 2023 user.notice SQM: Starting SQM script: piece_of_cake.qos on wan, in: 0 Kbps, out: 0 Kbps
Wed Mar 29 10:44:30 2023 user.notice SQM: piece_of_cake.qos was started on wan successfully
Wed Mar 29 10:44:31 2023 user.notice firewall: Reloading firewall due to ifup of wan6 (wan)
Wed Mar 29 10:44:34 2023 daemon.info hostapd: wlan1: STA 5c:c9:d3:75:b7:07 IEEE 802.11: authenticated
Wed Mar 29 10:44:34 2023 daemon.info hostapd: wlan1: STA 5c:c9:d3:75:b7:07 IEEE 802.11: associated (aid 1)
Wed Mar 29 10:44:34 2023 daemon.notice hostapd: wlan1: AP-STA-CONNECTED 5c:c9:d3:75:b7:07
Wed Mar 29 10:44:34 2023 daemon.info hostapd: wlan1: STA 5c:c9:d3:75:b7:07 WPA: pairwise key handshake completed (RSN)
Wed Mar 29 10:44:34 2023 daemon.notice hostapd: wlan1: EAPOL-4WAY-HS-COMPLETED 5c:c9:d3:75:b7:07
Wed Mar 29 10:44:35 2023 daemon.info hostapd: wlan1: STA 60:ab:67:f6:f4:c3 IEEE 802.11: authenticated
Wed Mar 29 10:44:35 2023 daemon.notice hostapd: wlan1: STA-OPMODE-N_SS-CHANGED 60:ab:67:f6:f4:c3 1
Wed Mar 29 10:44:35 2023 daemon.info hostapd: wlan1: STA 60:ab:67:f6:f4:c3 IEEE 802.11: associated (aid 2)
Wed Mar 29 10:44:35 2023 daemon.notice hostapd: wlan1: AP-STA-CONNECTED 60:ab:67:f6:f4:c3
Wed Mar 29 10:44:35 2023 daemon.info hostapd: wlan1: STA 60:ab:67:f6:f4:c3 WPA: pairwise key handshake completed (RSN)
Wed Mar 29 10:44:35 2023 daemon.notice hostapd: wlan1: EAPOL-4WAY-HS-COMPLETED 60:ab:67:f6:f4:c3
Wed Mar 29 10:44:35 2023 daemon.warn dnsmasq[1]: Ignoring query from non-local network
Wed Mar 29 10:44:36 2023 daemon.info dnsmasq-dhcp[1]: DHCPDISCOVER(br-lan) 192.168.1.101 a2:dc:2c:2a:67:74
Wed Mar 29 10:44:36 2023 daemon.info dnsmasq-dhcp[1]: DHCPOFFER(br-lan) 192.168.1.101 a2:dc:2c:2a:67:74
Wed Mar 29 10:44:40 2023 daemon.info dnsmasq-dhcp[1]: DHCPDISCOVER(br-lan) 192.168.1.129 c4:34:6b:ab:e4:ff
Wed Mar 29 10:44:40 2023 daemon.info dnsmasq-dhcp[1]: DHCPOFFER(br-lan) 192.168.1.130 c4:34:6b:ab:e4:ff
Wed Mar 29 10:44:40 2023 daemon.info dnsmasq-dhcp[1]: DHCPREQUEST(br-lan) 192.168.1.235 5c:c9:d3:75:b7:07
Wed Mar 29 10:44:40 2023 daemon.info dnsmasq-dhcp[1]: DHCPACK(br-lan) 192.168.1.235 5c:c9:d3:75:b7:07
Wed Mar 29 10:44:40 2023 daemon.info dnsmasq-dhcp[1]: DHCPREQUEST(br-lan) 192.168.1.161 60:ab:67:f6:f4:c3
Wed Mar 29 10:44:40 2023 daemon.info dnsmasq-dhcp[1]: DHCPACK(br-lan) 192.168.1.161 60:ab:67:f6:f4:c3
Wed Mar 29 10:44:40 2023 daemon.info dnsmasq-dhcp[1]: DHCPREQUEST(br-lan) 192.168.1.101 a2:dc:2c:2a:67:74
Wed Mar 29 10:44:40 2023 daemon.info dnsmasq-dhcp[1]: DHCPACK(br-lan) 192.168.1.101 a2:dc:2c:2a:67:74 orangepi5
Wed Mar 29 10:44:40 2023 daemon.info dnsmasq-dhcp[1]: DHCPDISCOVER(br-lan) 192.168.1.235 5c:c9:d3:75:b7:07
Wed Mar 29 10:44:40 2023 daemon.info dnsmasq-dhcp[1]: DHCPOFFER(br-lan) 192.168.1.235 5c:c9:d3:75:b7:07
Wed Mar 29 10:44:40 2023 daemon.info dnsmasq-dhcp[1]: DHCPREQUEST(br-lan) 192.168.1.161 60:ab:67:f6:f4:c3
Wed Mar 29 10:44:40 2023 daemon.info dnsmasq-dhcp[1]: DHCPACK(br-lan) 192.168.1.161 60:ab:67:f6:f4:c3
Wed Mar 29 10:44:40 2023 daemon.info dnsmasq-dhcp[1]: DHCPREQUEST(br-lan) 192.168.1.161 60:ab:67:f6:f4:c3
Wed Mar 29 10:44:40 2023 daemon.info dnsmasq-dhcp[1]: DHCPACK(br-lan) 192.168.1.161 60:ab:67:f6:f4:c3
Wed Mar 29 10:44:40 2023 daemon.info dnsmasq-dhcp[1]: DHCPDISCOVER(br-lan) 192.168.1.235 5c:c9:d3:75:b7:07
Wed Mar 29 10:44:40 2023 daemon.info dnsmasq-dhcp[1]: DHCPOFFER(br-lan) 192.168.1.235 5c:c9:d3:75:b7:07
Wed Mar 29 10:44:40 2023 daemon.info dnsmasq-dhcp[1]: DHCPREQUEST(br-lan) 192.168.1.130 c4:34:6b:ab:e4:ff
Wed Mar 29 10:44:40 2023 daemon.info dnsmasq-dhcp[1]: DHCPACK(br-lan) 192.168.1.130 c4:34:6b:ab:e4:ff cantalupo
Wed Mar 29 10:44:40 2023 daemon.info dnsmasq-dhcp[1]: DHCPREQUEST(br-lan) 192.168.1.235 5c:c9:d3:75:b7:07
Wed Mar 29 10:44:40 2023 daemon.info dnsmasq-dhcp[1]: DHCPACK(br-lan) 192.168.1.235 5c:c9:d3:75:b7:07
Wed Mar 29 10:44:43 2023 daemon.info hostapd: wlan1: STA ec:f4:51:15:37:ae IEEE 802.11: authenticated
Wed Mar 29 10:44:43 2023 daemon.info hostapd: wlan1: STA ec:f4:51:15:37:ae IEEE 802.11: associated (aid 3)
Wed Mar 29 10:44:43 2023 daemon.notice hostapd: wlan1: AP-STA-CONNECTED ec:f4:51:15:37:ae
Wed Mar 29 10:44:43 2023 daemon.info hostapd: wlan1: STA ec:f4:51:15:37:ae WPA: pairwise key handshake completed (RSN)
Wed Mar 29 10:44:43 2023 daemon.notice hostapd: wlan1: EAPOL-4WAY-HS-COMPLETED ec:f4:51:15:37:ae
Wed Mar 29 10:44:51 2023 daemon.info dnsmasq-dhcp[1]: DHCPDISCOVER(br-lan) ec:f4:51:15:37:ae
Wed Mar 29 10:44:51 2023 daemon.info dnsmasq-dhcp[1]: DHCPOFFER(br-lan) 192.168.1.122 ec:f4:51:15:37:ae
Wed Mar 29 10:44:51 2023 daemon.info dnsmasq-dhcp[1]: DHCPDISCOVER(br-lan) ec:f4:51:15:37:ae
Wed Mar 29 10:44:51 2023 daemon.info dnsmasq-dhcp[1]: DHCPOFFER(br-lan) 192.168.1.122 ec:f4:51:15:37:ae
Wed Mar 29 10:44:51 2023 daemon.info dnsmasq-dhcp[1]: DHCPREQUEST(br-lan) 192.168.1.122 ec:f4:51:15:37:ae
Wed Mar 29 10:44:51 2023 daemon.info dnsmasq-dhcp[1]: DHCPACK(br-lan) 192.168.1.122 ec:f4:51:15:37:ae LGwebOSTV
Wed Mar 29 10:45:19 2023 daemon.info hostapd: wlan0: STA 04:d9:f5:6d:7b:61 IEEE 802.11: authenticated
Wed Mar 29 10:45:19 2023 daemon.info hostapd: wlan0: STA 04:d9:f5:6d:7b:61 IEEE 802.11: associated (aid 1)
Wed Mar 29 10:45:19 2023 daemon.notice hostapd: wlan0: AP-STA-CONNECTED 04:d9:f5:6d:7b:61
Wed Mar 29 10:45:19 2023 daemon.info hostapd: wlan0: STA 04:d9:f5:6d:7b:61 WPA: pairwise key handshake completed (RSN)
Wed Mar 29 10:45:19 2023 daemon.notice hostapd: wlan0: EAPOL-4WAY-HS-COMPLETED 04:d9:f5:6d:7b:61
Wed Mar 29 10:45:23 2023 daemon.info dnsmasq-dhcp[1]: DHCPDISCOVER(br-lan) 04:d9:f5:6d:7b:61
Wed Mar 29 10:45:23 2023 daemon.info dnsmasq-dhcp[1]: DHCPOFFER(br-lan) 192.168.1.220 04:d9:f5:6d:7b:61
Wed Mar 29 10:45:23 2023 daemon.info dnsmasq-dhcp[1]: DHCPDISCOVER(br-lan) 04:d9:f5:6d:7b:61
Wed Mar 29 10:45:23 2023 daemon.info dnsmasq-dhcp[1]: DHCPOFFER(br-lan) 192.168.1.220 04:d9:f5:6d:7b:61
Wed Mar 29 10:45:23 2023 daemon.info dnsmasq-dhcp[1]: DHCPREQUEST(br-lan) 192.168.1.220 04:d9:f5:6d:7b:61
Wed Mar 29 10:45:23 2023 daemon.info dnsmasq-dhcp[1]: DHCPACK(br-lan) 192.168.1.220 04:d9:f5:6d:7b:61
Wed Mar 29 10:56:53 2023 user.info : luci: accepted login on /admin/status/vnstat2 for root from 192.168.1.101
Wed Mar 29 11:16:59 2023 daemon.notice hostapd: wlan0: AP-STA-DISCONNECTED 04:d9:f5:6d:7b:61
Wed Mar 29 11:17:05 2023 daemon.info hostapd: wlan0: STA 04:d9:f5:6d:7b:61 IEEE 802.11: authenticated
Wed Mar 29 11:17:05 2023 daemon.info hostapd: wlan0: STA 04:d9:f5:6d:7b:61 IEEE 802.11: associated (aid 1)
Wed Mar 29 11:17:05 2023 daemon.notice hostapd: wlan0: AP-STA-CONNECTED 04:d9:f5:6d:7b:61
Wed Mar 29 11:17:05 2023 daemon.info hostapd: wlan0: STA 04:d9:f5:6d:7b:61 WPA: pairwise key handshake completed (RSN)
Wed Mar 29 11:17:05 2023 daemon.notice hostapd: wlan0: EAPOL-4WAY-HS-COMPLETED 04:d9:f5:6d:7b:61
Wed Mar 29 11:17:05 2023 daemon.info dnsmasq-dhcp[1]: DHCPDISCOVER(br-lan) 04:d9:f5:6d:7b:61
Wed Mar 29 11:17:05 2023 daemon.info dnsmasq-dhcp[1]: DHCPOFFER(br-lan) 192.168.1.220 04:d9:f5:6d:7b:61
Wed Mar 29 11:17:05 2023 daemon.info dnsmasq-dhcp[1]: DHCPREQUEST(br-lan) 192.168.1.220 04:d9:f5:6d:7b:61
Wed Mar 29 11:17:05 2023 daemon.info dnsmasq-dhcp[1]: DHCPACK(br-lan) 192.168.1.220 04:d9:f5:6d:7b:61

Where was the DB located ?

2 Likes

In the default vnstat directory.

Wow, can you be more vague ?

If the "default vnstat directory" is /tmp, then no surprise.

1 Like

Now I realized that there is no /var.
Sorry, I don't know where OpenWrt's DB vnstat is located.

Checked /tmp ?
That would be the logical location, to avoid flash wear.

2 Likes

I am found: /tmp/lib/vnstat/vnstat.db

cat /etc/vnstat.conf | head -n 10

1 Like
root@OpenWrt:/tmp/lib/vnstat# cat /etc/vnstat.conf
# vnStat 2.9 configuration file
#
# lines starting with # or ; are comments, everything has default
# values, remove ; before each option to change its value


# default interface (leave empty for automatic selection)
;Interface ""

# location of the database directory
;DatabaseDir "/var/lib/vnstat"

# locale (LC_ALL) ("-" = use system locale)
;Locale "-"

# date output formats for -d, -m, -t and -w
;DayFormat    "%Y-%m-%d"
;MonthFormat  "%Y-%m"
;TopFormat    "%Y-%m-%d"

# characters used for visuals
;RXCharacter       "%"
;TXCharacter       ":"
;RXHourCharacter   "r"
;TXHourCharacter   "t"

# how units are prefixed when traffic is shown
# 0 = IEC standard prefixes (KiB/MiB/GiB...)
# 1 = old style binary prefixes (KB/MB/GB...)
# 2 = SI decimal prefixes (kB/MB/GB...)
;UnitMode 0

# used rate unit (0 = bytes, 1 = bits)
;RateUnit 1

# how units are prefixed when traffic rate is shown in bits
# 0 = IEC binary prefixes (Kibit/s...)
# 1 = SI decimal prefixes (kbit/s...)
;RateUnitMode 1

# output style
# 0 = minimal & narrow, 1 = bar column visible
# 2 = same as 1 except rate in summary
# 3 = rate column visible
;OutputStyle 3
;EstimateBarVisible 1

# number of decimals to use in outputs
;DefaultDecimals 2
;HourlyDecimals 1

# spacer for separating hourly sections (0 = none, 1 = '|', 2 = '][', 3 = '[ ]')
;HourlySectionStyle 2

# how many seconds should sampling for -tr take by default
;Sampletime 5

# default query mode
# 0 = normal, 1 = days, 2 = months, 3 = top, 5 = short
# 7 = hours, 8 = xml, 9 = one line, 10 = json
;QueryMode 0

# default list output entry limits (0 = all)
;List5Mins      24
;ListHours      24
;ListDays       30
;ListMonths     12
;ListYears       0
;ListTop        10

# how to match interface given for query to interface in database
# 0 = case sensitive exact match to interface name
# 1 = method 0 followed by case sensitive exact match of alias
# 2 = method 1 followed by case insensitive exact match of alias
# 3 = method 2 followed by case insensitive beginning match of alias
;InterfaceMatchMethod 3


# vnstatd
##

# switch to given user when started as root (leave empty to disable)
;DaemonUser ""

# switch to given group when started as root (leave empty to disable)
;DaemonGroup ""

# try to detect interface maximum bandwidth, 0 = disable feature
# MaxBandwidth will be used as fallback value when enabled
;BandwidthDetection 1

# maximum bandwidth (Mbit) for all interfaces, 0 = disable feature
# (unless interface specific limit is given)
;MaxBandwidth 1000

# interface specific limits
#  example 8Mbit limit for eth0 (remove # to activate):
#MaxBWeth0 8

# data retention durations (-1 = unlimited, 0 = feature disabled)
;5MinuteHours   48
;HourlyDays      4
;DailyDays      62
;MonthlyMonths  25
;YearlyYears    -1
;TopDayEntries  20

# how often (in seconds) interface data is updated
;UpdateInterval 20

# how often (in seconds) interface status changes are checked
;PollInterval 5

# how often (in minutes) data is saved to database
;SaveInterval 5

# how often (in minutes) data is saved when all interface are offline
;OfflineSaveInterval 30

# rescan database after save for new interfaces to be monitored (1 = enabled, 0 = disabled)
;RescanDatabaseOnSave 1

# automatically start monitoring all interfaces not found in the database
# (1 = enabled, 0 = disabled)
;AlwaysAddNewInterfaces 0

# on which day should months change
;MonthRotate 1
;MonthRotateAffectsYears 0

# filesystem disk space check (1 = enabled, 0 = disabled)
;CheckDiskSpace 1

# how much the boot time can variate between updates (seconds)
;BootVariation 15

# create database entries even when there is no traffic (1 = enabled, 0 = disabled)
;TrafficlessEntries 1

# how many minutes to wait during daemon startup for system clock to
# sync time if most recent database update appears to be in the future
;TimeSyncWait 5

# how often (in minutes) bandwidth detection is done when
# BandwidthDetection is enabled (0 = disabled)
;BandwidthDetectionInterval 5

# force data save when interface status changes (1 = enabled, 0 = disabled)
;SaveOnStatusChange 1

# enable / disable logging (0 = disabled, 1 = logfile, 2 = syslog)
;UseLogging 2

# create dirs if needed (1 = enabled, 0 = disabled)
;CreateDirs 1

# update ownership of files if needed (1 = enabled, 0 = disabled)
;UpdateFileOwner 1

# file used for logging if UseLogging is set to 1
;LogFile "/var/log/vnstat/vnstat.log"

# file used as daemon pid / lock file
;PidFile "/var/run/vnstat/vnstat.pid"

# 1 = 64-bit, 0 = 32-bit, -1 = old style logic, -2 = automatic detection
;64bitInterfaceCounters -2

# use SQLite Write-Ahead Logging mode (1 = enabled, 0 = disabled)
;DatabaseWriteAheadLogging 0

# change the setting of the SQLite "synchronous" flag
# (-1 = auto, 0 = off, 1, = normal, 2 = full, 3 = extra)
;DatabaseSynchronous -1

# database uses UTC instead of local timezone (1 = enabled, 0 = disabled)
;UseUTC 0


# vnstati
##

# title timestamp format
;HeaderFormat "%Y-%m-%d %H:%M"

# show hours with rate (1 = enabled, 0 = disabled)
;HourlyRate 1

# show rate in summary (1 = enabled, 0 = disabled)
;SummaryRate 1

# transparent background (1 = enabled, 0 = disabled)
;TransparentBg 0

# image size control
;LargeFonts 0
;LineSpacingAdjustment 0
;ImageScale 100

# 5 minutes graph size control
;5MinuteGraphResultCount 576
;5MinuteGraphHeight 300

# hourly graph mode (0 = 24 hour sliding window, 1 = begins from midnight)
;HourlyGraphMode 0

# horizontal/vertical summary graph (0 = hours, 1 = 5 minutes)
;SummaryGraph 0

# traffic estimate bar style
# (0 = not shown, 1 = continuation of existing bar, 2 = separate bar)
;EstimateStyle 1

# bar column in list outputs shows rate if OutputStyle is 3
# (1 = enabled, 0 = disabled)
;BarColumnShowsRate 0

# image colors
;CBackground     "FFFFFF"
;CEdge           "AEAEAE"
;CHeader         "606060"
;CHeaderTitle    "FFFFFF"
;CHeaderDate     "FFFFFF"
;CText           "000000"
;CLine           "B0B0B0"
;CLineL          "-"
;CRx             "92CF00"
;CTx             "606060"
;CRxD            "-"
;CTxD            "-"

/tmp is ram, you reboot, it's gone.

3 Likes

Point it to a USB drive for persistent storage.

1 Like

... or an off device, network drive.

1 Like

@RuralRoots @frollic

How can I store this database?
My router does not have a USB port.

Sorry, you wrote store, not restore.

As I said, network storage, like a file share.

1 Like

How can I do this?

Mount it as any other drive in Linux, on the router, put the DB there.

1 Like

I use linux, my machine:
IPv4: 192.168.1.101
IPv6: 2804:29b8:509d:dd5a::42b

How can I do this by selecting my machine?

# location of the database directory
;DatabaseDir "/var/lib/vnstat"

Just make sure the mount is there before you attempt to start vnstat, or you'll end up writing the file in the wrong spot.

Ideally put the mount point somewhere in /tmp, if the mount would fail, you still won't kill your flash with writes.