IS_EVOBACKUP_EXCLUDE_MOUNT fail to work on old evobackup versions #150

Closed
opened 2023-11-22 17:22:54 +01:00 by mtrossevin · 0 comments
Owner

Lines 553 to 561 in 081a816
if grep -q "^VERSION=" "${evobackup_file}"; then
evobackup_version=$(sed -E -n 's/VERSION="(.*)"/\1/p' "${evobackup_file}")
# versions over 22.12 use a new syntax to exclude rsync files
if dpkg --compare-versions "$evobackup_version" ge 22.12 ; then
sed -En '/RSYNC_EXCLUDES="/,/"/ {s/(RSYNC_EXCLUDES=|")//g;p}' > "${excludes_file}"
else
grep -- "--exclude " "${evobackup_file}" | grep -E -o "\"[^\"]+\"" | tr -d '"' > "${excludes_file}"
fi
fi

results in old evobackup to be considered to not have any excludes.

This might work better for old versions of evobackup (those without VERSION=) :

if grep -q  "^VERSION=" "${evobackup_file}" && dpkg --compare-versions "$(sed -E -n 's/VERSION="(.*)"/\1/p' "${evobackup_file}")"  ge 22.12 ; then
    sed -En '/RSYNC_EXCLUDES="/,/"/ {s/(RSYNC_EXCLUDES=|")//g;p}' "${evobackup_file}" > "${excludes_file}"
else
    grep -- "--exclude " "${evobackup_file}" | grep -E -o "\"[^\"]+\"" | tr -d '"' > "${excludes_file}"
fi

Or repeat the later case (the one for the old evobackups).

https://gitea.evolix.org/evolix/evocheck/src/commit/081a8166ccda9423b03c8acc559953caacfd7334/linux/evocheck.sh#L553-L561 results in old evobackup to be considered to not have any excludes. This might work better for old versions of evobackup (those without `VERSION=`) : ```sh if grep -q "^VERSION=" "${evobackup_file}" && dpkg --compare-versions "$(sed -E -n 's/VERSION="(.*)"/\1/p' "${evobackup_file}")" ge 22.12 ; then sed -En '/RSYNC_EXCLUDES="/,/"/ {s/(RSYNC_EXCLUDES=|")//g;p}' "${evobackup_file}" > "${excludes_file}" else grep -- "--exclude " "${evobackup_file}" | grep -E -o "\"[^\"]+\"" | tr -d '"' > "${excludes_file}" fi ``` Or repeat the later case (the one for the old `evobackup`s).
mtrossevin added the
bug
label 2023-11-22 17:22:54 +01:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: evolix/evocheck#150
No description provided.