mirror of
https://github.com/Ponce/slackbuilds
synced 2024-11-22 19:44:21 +01:00
ca99f7fbf7
Signed-off-by: B. Watson <yalhcru@gmail.com>
21 lines
594 B
Text
21 lines
594 B
Text
To run vnstat from cron, add the following line to your crontab:
|
|
|
|
0-55/5 * * * * if [[ -x /usr/bin/vnstat && $(ls /var/lib/vnstat/ | wc -l) -ge 1 ]]; then /usr/bin/vnstat -u; fi
|
|
|
|
To run vnstat from /etc/rc.d:
|
|
chmod +x /etc/rc.d/rc.vnstat
|
|
|
|
Note that to have vnstat start automatically this way it should be
|
|
called from rc.local (and optionally rc.local_shutdown) like so:
|
|
|
|
In rc.local:
|
|
# Start vnstat
|
|
if [ -x /etc/rc.d/rc.vnstat ]; then
|
|
/etc/rc.d/rc.vnstat start
|
|
fi
|
|
|
|
In rc.local_shutdown:
|
|
# Stop vnstat
|
|
if [ -x /etc/rc.d/rc.vnstat ]; then
|
|
/etc/rc.d/rc.vnstat stop
|
|
fi
|