From patchwork Wed Dec 25 13:48:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adolf Belka X-Patchwork-Id: 8369 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 (secp384r1) client-signature RSA-PSS (4096 bits)) (Client CN "mail01.haj.ipfire.org", Issuer "R11" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4YJClh28WQz3xDX for ; Wed, 25 Dec 2024 13:48:48 +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 RSA-PSS (4096 bits) client-signature ECDSA (secp384r1)) (Client CN "mail02.haj.ipfire.org", Issuer "E6" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4YJClc6VjWz4cX; Wed, 25 Dec 2024 13:48:44 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4YJClc5vgGz34Kv; Wed, 25 Dec 2024 13:48:44 +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 (secp384r1) client-signature RSA-PSS (4096 bits)) (Client CN "mail01.haj.ipfire.org", Issuer "R11" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4YJClV0CBlz33tF for ; Wed, 25 Dec 2024 13:48:38 +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 RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail01.ipfire.org (Postfix) with ESMTPSA id 4YJClT5rDpzCD; Wed, 25 Dec 2024 13:48:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1735134517; 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: in-reply-to:in-reply-to:references:references; bh=OPK0QFJJkTrWfLTiWMoiJfSBuezoEVCMgEmWYwm7Q28=; b=fohJdLRwgEiIZ8Di3omYawmfay6X0l1xDk3P5OSIUV3Cls7NxRnxpgkr5AEJht0aMGfaSX RPaHu+Zkwf5vkc/pMUSzYmgvnpGh5IB3KdvfrO1dyxifJQGKnjGIHZ1mcoQubFqFNez0D7 3IYCL9JUYlTksCy79Cnqtp9ceK6TpViCxU00mh1TjE00YQdwUko4LzA9PaE+hBKy1YXO6W +UhgcpHikudQisODIfFUpidNl8V7aZN6rOqfnPh/W24jJJmUApWbTwLS8Us8R5zV9cnUQd jt4jUquInP5BRwMnjOYM/f0gVwMLDGhWycVnzlZ+f/LY9YupVCdAMv4l2jlNAQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1735134517; 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: in-reply-to:in-reply-to:references:references; bh=OPK0QFJJkTrWfLTiWMoiJfSBuezoEVCMgEmWYwm7Q28=; b=zWY3a1gFtqjXFGz8ajjaLzDpF+LC2ChS7CDTQhUb6vIixR7NAqumHjbT4BkghBDk3y3x8V 9+lV2RoUoVsPfBBg== From: Adolf Belka To: development@lists.ipfire.org Subject: [PATCH 4/7] backup.pl: Update to migrate rrd directories for collectd-5.x Date: Wed, 25 Dec 2024 14:48:25 +0100 Message-ID: <20241225134828.6231-4-adolf.belka@ipfire.org> In-Reply-To: <20241225134828.6231-1-adolf.belka@ipfire.org> References: <20241225134828.6231-1-adolf.belka@ipfire.org> MIME-Version: 1.0 Message-ID-Hash: CKQR6UN5RG3Z454T3OVS2NW62TIDWV5W X-Message-ID-Hash: CKQR6UN5RG3Z454T3OVS2NW62TIDWV5W X-MailFrom: adolf.belka@ipfire.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.8 Precedence: list List-Id: IPFire development talk Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Tested-by: Adolf Belka Signed-off-by: Adolf Belka --- config/backup/backup.pl | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/config/backup/backup.pl b/config/backup/backup.pl index 3b10b8707..fb7b210db 100644 --- a/config/backup/backup.pl +++ b/config/backup/backup.pl @@ -258,6 +258,16 @@ restore_backup() { if [ -e /var/lib/ipblocklist/SPAMHAUS_EDROP.conf ]; then rm /var/lib/ipblocklist/SPAMHAUS_EDROP.conf fi + + # Create collectd 4.x to 5.x migration script from rrd contents, run the script that + # was created and then remove the old interface directory if it is present as it will + # be empty after the migration has been carried out. + /var/ipfire/collectd-migrate-4-to-5.pl --indir /var/log/rrd/ > /tmp/rrd-migrate.sh + sh /tmp/rrd-migrate.sh >/dev/null 2>&1 + if [ -d /var/log/rrd/collectd/localhost/interface/ ]; then + rm -Rf /var/log/rrd/collectd/localhost/interface/ + fi + return 0 }