| Both sides previous revision Previous revision Next revision | Previous revision Next revisionBoth sides next revision |
| docs:guide-user:services:network_monitoring:vnstat [2018/03/04 08:08] – bobafetthotmail | docs:guide-user:services:network_monitoring:vnstat [2018/07/26 23:50] – unregistered |
|---|
| vnStat stores stats to /var/lib/vnstat by default and information will not persist across restarts. This means that one might want to relocate the database directory to other forms of persistent storage like your device's flash or external thumb drives. | vnStat stores stats to /var/lib/vnstat by default and information will not persist across restarts. This means that one might want to relocate the database directory to other forms of persistent storage like your device's flash or external thumb drives. |
| |
| By default, vnStat is configured to write to the directory in volatile memory every 30 minutes. Both the directory and the interval can be adjusted in vnStat's configuration. However, keep in mind that frequent writes to flash memory will deteriorate and potentially damage flash memory. Changing the directory to write to flash memory without changing the interval will result in around 17500 write operations, a number that could potentially cause problems. | By default, vnStat is configured to write to the directory in volatile memory every 30 minutes. Both the directory and the interval can be adjusted in vnStat's configuration. However, keep in mind that frequent writes to flash memory will deteriorate and potentially damage flash memory. Changing the directory to write to flash memory without changing the interval will result in around 17500 write operations each year, a number that could potentially cause problems. |
| |
| Additionally, the database may not persist across firmware flashes. | Additionally, the database may not persist across firmware flashes. |
| == Add for cron and for init == | == Add for cron and for init == |
| The below commands will add a cronjob entry that triggers a backup every 6 hours every day, if necessary adjust to an interval you feel comfortable with: | The below commands will add a cronjob entry that triggers a backup every 6 hours every day, if necessary adjust to an interval you feel comfortable with: |
| <code>echo "* */6 * * * /etc/init.d/vnstat_backup backup" >> /etc/crontabs/root | <code>echo "0 */6 * * * /etc/init.d/vnstat_backup backup" >> /etc/crontabs/root |
| /etc/init.d/cron restart</code> | /etc/init.d/cron restart</code> |