You could automate running your mrtg
command with cron. If your system has a directory named /etc/cron.d/
, create a new one-line file there with the following contents:
*/5 * * * * root LANG=C /usr/bin/mrtg /etc/mrtg/mymrtg.cfg >/dev/null 2>&1
This tells cron to run your command every 5 minutes, as the user root, with LANG=C
in the environment.
If your system does not have a /etc/cron.d/
, then you'll have to insert the above crontab line in an alternate place, such as the root user's crontab. You can do that by running crontab -e
as root. In that case, your crontab line should omit the username field (root
), but will otherwise be the same as before:
*/5 * * * * LANG=C /usr/bin/mrtg /etc/mrtg/mymrtg.cfg >/dev/null 2>&1