From patchwork Thu Aug 25 00:31:29 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: jon X-Patchwork-Id: 5985 Return-Path: Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384 client-signature ECDSA (P-384) client-digest SHA384) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4MCkSL5k9jz3wdF for ; Thu, 25 Aug 2022 00:32:18 +0000 (UTC) Received: from mail02.haj.ipfire.org (mail02.haj.ipfire.org [172.28.1.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384 client-signature ECDSA (P-384) client-digest SHA384) (Client CN "mail02.haj.ipfire.org", Issuer "R3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4MCkSJ425dz46P; Thu, 25 Aug 2022 00:32:16 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4MCkSJ240zz2yjy; Thu, 25 Aug 2022 00:32:16 +0000 (UTC) Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384 client-signature ECDSA (P-384) client-digest SHA384) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4MCkSH0LQJz2y0x for ; Thu, 25 Aug 2022 00:32:15 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by mail01.ipfire.org (Postfix) with ESMTPSA id 4MCkSG0MMdzhH; Thu, 25 Aug 2022 00:32:13 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1661387534; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=3T0HBb1+j42CLhcLLPqcVCyFRfFz7kzlOgA1LzhWaVU=; b=rAINqU5L6twEv+GLjjCmYL1FrLUiE5dsICdSMa7ITB58JmuBlWXd9yQXebbAi/eh0VZrrC qdx0PFHMfm36ctDg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1661387534; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=3T0HBb1+j42CLhcLLPqcVCyFRfFz7kzlOgA1LzhWaVU=; b=LdgLQTUmZwElAv2YYheK7GE15V51UdndLv4YVRGjAn9+cPS/RJrkRhREpjlsKua7wacood cyoaeZtsKiBJFVgj9Mkn8938jZXWpt9+6SvyEMhgWU0ObG1ya39JjJ44BUh+LvvcHhQnuZ U+dh1q1r6lghpy1eHqNWvHQlkUjAT+ulsiQXBGdjEpEWKha4bTI6IQeFuiX9hMsf1izrEj eZvwyRi+0cBhnsSCfHLUyJl+8Ysco0h4yVUKF2TCPbNkFfv+dGzco8bYiMwNO5VJvHnrjN 42x+1Xzytosg2LmC3xnj4Dt7Jxt+YxKU70JMeRyspS5698fC8y8SbYZ4Cr+v4Q== From: Jon Murphy To: development@lists.ipfire.org Subject: [PATCH] crontab: add periodic cleanup the collectd RRD (graphs) Date: Wed, 24 Aug 2022 19:31:29 -0500 Message-Id: <20220825003129.3552746-1-jon.murphy@ipfire.org> MIME-Version: 1.0 X-BeenThere: development@lists.ipfire.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: IPFire development talk List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: development-bounces@lists.ipfire.org Sender: "Development" - 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 Reviewed-by: Bernhard Bitsch Reviewed-by: Michael Tremer --- config/cron/crontab | 3 +++ 1 file changed, 3 insertions(+) diff --git a/config/cron/crontab b/config/cron/crontab index b727531fc..7088e0b75 100644 --- a/config/cron/crontab +++ b/config/cron/crontab @@ -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