]> git.ipfire.org Git - ipfire-2.x.git/commitdiff
crontab: add periodic cleanup the collectd RRD (graphs)
authorJon Murphy <jon.murphy@ipfire.org>
Thu, 25 Aug 2022 00:31:29 +0000 (19:31 -0500)
committerPeter Müller <peter.mueller@ipfire.org>
Fri, 23 Sep 2022 10:38:11 +0000 (10:38 +0000)
- 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>
config/cron/crontab

index b727531fc2f32bc8fb316e21154ec61131d9501f..7088e0b750a755b860a478b47d6be8809aacd803 100644 (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