crontab: add periodic cleanup the collectd RRD (graphs)

- Created (mostly) for old openvpn graphs
- RRD removed when no graph modification for +365 days
  - chosen since graph max out is 365 days
- fcron job runs once per week
  - chosen since this is just a cleanup and it doesnt need to run everyday
Note: logging can be added if needed.

Signed-off-by: Jon Murphy <jon.murphy@ipfire.org>
Reviewed-by: Bernhard Bitsch <bbitsch@ipfire.org>
Reviewed-by: Michael Tremer <michael.tremer@ipfire.org>
This commit is contained in:
Jon Murphy 2022-08-24 19:31:29 -05:00 committed by Peter Müller
parent c2993d5e58
commit 73b4043143
1 changed files with 3 additions and 0 deletions

View File

@ -80,5 +80,8 @@ HOME=/
# Cleanup the mail spool directory
%weekly * * /usr/sbin/dma-cleanup-spool
# Cleanup the collectd RRD (graphs)
%weekly * * /bin/find /var/log/rrd -mtime +365 -type f -name '*.rrd' -delete -o -type d -empty -delete
# Update DNS trust anchor
%daily,random * * @runas(nobody) /usr/sbin/unbound-anchor -a /var/lib/unbound/root.key -c /etc/unbound/icannbundle.pem