From patchwork Fri Mar 25 12:22:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adolf Belka X-Patchwork-Id: 5402 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 4KQ1T06d7jz3wtb for ; Fri, 25 Mar 2022 12:23:00 +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) client-signature ECDSA (P-384)) (Client CN "mail02.haj.ipfire.org", Issuer "R3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4KQ1Sz1zQZz14T; Fri, 25 Mar 2022 12:22:59 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4KQ1Sz1Qktz2xR5; Fri, 25 Mar 2022 12:22:59 +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 4KQ1Sy0ZL8z2xGC for ; Fri, 25 Mar 2022 12:22:58 +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 4KQ1Sx3TTvzXD; Fri, 25 Mar 2022 12:22:57 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1648210977; 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=KuAqpp/9dYft4HZHdw+0he5bsMvLwOoJ5lv3h2qy20U=; b=EfIwgy7CEZ+vBk4jFjtQZJ7xzveFhfxIotxoB4lvPA3yJiEyvdEmz181SNQrrd5Wp6+oOX EWcDUfh95BkTXwDA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1648210977; 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=KuAqpp/9dYft4HZHdw+0he5bsMvLwOoJ5lv3h2qy20U=; b=LAzbuPbKkoevsjmX1jk5Hw3fT1gmVmikAZusBIa6Mgtd+dn26Gsu/c1cf/9EEvlm8s8GOn Ca6EqmtIKjMHQaMxl1h5Y5u2+s2gcAVxbbmjD00hP9QWFCiwdR9rrh2qkryTJMR5eRYKHf qq//va5upMIyp1uFHqj3uURLCgGNpPyyTvjW5bbOFqT6btINdz3Iuf7nHSwxVZJtPhTnVs pc9V8rNIghPMidFOyd6HpGk87a6A1Y1ThUmbVywMKNpsnNQWr2kNXtW9xufcncW5m7wT7t VPn/BLk3jhBM7vEqZHw6QOSCUxYGAEVpGumJH7XzZTM/OZS32zmgS7LoAaNl9A== From: Adolf Belka To: development@lists.ipfire.org Subject: [PATCH] backup.pl: fix Bug12817 - directories missing in backup after include file changed to relat> Date: Fri, 25 Mar 2022 13:22:47 +0100 Message-Id: <20220325122247.7036-1-adolf.belka@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" From: Bernhard Bitsch - The change of the backup include file from absolute paths to relative paths in CU164 commit https://git.ipfire.org/?p=ipfire-2.x.git;a=commit;h=c7e0d73e7cfd7be95db9d0a5f3392b8241813d5b resulted in 20 core function directories no longer being backed up. Additionally a similar effect occurred with some addon backups - Fix applied here proposed by Bernhard Bitsch and tested on a vm testbed system and confirmed to fix the problem. Backup of all directories again being done. Fixes: Bug12817 Tested-By: Adolf Belka Signed-off-by: Adolf Belka Reviewed-by: Bernhard Bitsch Tested-by: Bernhard Bitsch Acked-by: Bernhard Bitsch --- config/backup/backup.pl | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/config/backup/backup.pl b/config/backup/backup.pl index a2337cf23..c7dbc6cae 100644 --- a/config/backup/backup.pl +++ b/config/backup/backup.pl @@ -35,16 +35,18 @@ list_addons() { process_includes() { local include - for include in $@; do - local file - while read -r file; do - for file in ${file}; do - if [ -e "/${file}" ]; then - echo "${file}" - fi - done - done < "${include}" - done | sort -u + pushd / >/dev/null + for include in $@; do + local file + while read -r file; do + for file in ${file}; do + if [ -e "/${file}" ]; then + echo "${file}" + fi + done + done < "${include}" + done | sort -u + popd >/dev/null } make_backup() {