From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael Tremer To: development@lists.ipfire.org Subject: Re: [PATCH] backup: Fix broken globbing expansion Date: Tue, 29 Mar 2022 14:49:27 +0100 Message-ID: <91D09EBD-AF54-404E-86BB-84EDAA3ECCEC@ipfire.org> In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============4095081689955641531==" List-Id: --===============4095081689955641531== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable That is what I have been using to check if this works fine. > On 29 Mar 2022, at 14:36, Bernhard Bitsch wrote: >=20 > Hi, >=20 > Am 29.03.2022 um 15:11 schrieb Michael Tremer: >> Hello, >> Could you please send the file listing to find out what is being included = what shouldn=E2=80=99t? >=20 > Just for easy quick handling, you can use > '/var/ipfire/backup/bin/backup.pl list' to show the files included. >=20 > Bernhard >> -Michael >>> On 29 Mar 2022, at 14:10, Adolf Belka wrote: >>>=20 >>> Hi Michael, >>>=20 >>> Just tried this patch out on my vm testbed system and it still doesn't wo= rk for me. The backup file had got to 1.3GB when I deleted the backup file as= it was still growing. The normal correct backup file on that vm machine is a= round 7MB >>>=20 >>> The above was the case for both running it from the WUI or from the comma= nd line from my unprivileged user using sudo backupctrl exclude >>>=20 >>> Regards, >>>=20 >>> Adolf. >>>=20 >>>=20 >>> On 29/03/2022 14:27, Michael Tremer wrote: >>>> This patch fixes globbing expansion in the backup include file list >>>> which got broken in c7e0d73e7cfd7be95db9d0a5f3392b8241813d5b. >>>>=20 >>>> Signed-off-by: Michael Tremer >>>> --- >>>> config/backup/backup.pl | 8 ++++---- >>>> 1 file changed, 4 insertions(+), 4 deletions(-) >>>>=20 >>>> diff --git a/config/backup/backup.pl b/config/backup/backup.pl >>>> index a2337cf23..6f9295e94 100644 >>>> --- a/config/backup/backup.pl >>>> +++ b/config/backup/backup.pl >>>> @@ -19,6 +19,8 @@ >>>> # = # >>>> #######################################################################= ######## >>>> +shopt -s nullglob >>>> + >>>> NOW=3D"$(date "+%Y-%m-%d-%H:%M")" >>>> list_addons() { >>>> @@ -38,10 +40,8 @@ process_includes() { >>>> for include in $@; do >>>> local file >>>> while read -r file; do >>>> - for file in ${file}; do >>>> - if [ -e "/${file}" ]; then >>>> - echo "${file}" >>>> - fi >>>> + for file in /${file}; do >>>> + echo "${file}" >>>> done >>>> done < "${include}" >>>> done | sort -u --===============4095081689955641531==--