#2906 Issue closed: Usage of "EXCLUDE_BACKUP"

Labels: documentation, no-issue-activity

guru4712 opened issue at 2023-01-03 13:52:

  • ReaR version ("/usr/sbin/rear -V"):
    2.6-1

  • OS version ("cat /etc/os-release" or "lsb_release -a" or "cat /etc/rear/os.conf"):
    Red Hat Enterprise Linux Server release 7.6 (Maipo)

  • ReaR configuration files ("cat /etc/rear/site.conf" and/or "cat /etc/rear/local.conf"):

# for Backup only:
OUTPUT=USB
BACKUP=NETFS
BACKUP_URL=usb:///dev/disk/by-label/Elements_2TB
EXCLUDE_BACKUP=( '/var/log/sina' '/sina-root2' )
  • Hardware vendor/product (PC or PowerNV BareMetal or ARM) or VM (KVM guest or PowerVM LPAR):
    Fujitsu Server "PRIMERGY TX150 S8"

  • System architecture (x86 compatible or PPC64/PPC64LE or what exact ARM device):
    x86_64

  • Firmware (BIOS or UEFI or Open Firmware) and bootloader (GRUB or ELILO or Petitboot):
    BIOS - GRUB2

  • Storage (local disk or SSD) and/or SAN (FC or iSCSI or FCoE) and/or multipath (DM or NVMe):
    local disk

  • Storage layout ("lsblk -ipo NAME,KNAME,PKNAME,TRAN,TYPE,FSTYPE,LABEL,SIZE,MOUNTPOINT"):

/dev/sda    /dev/sda                  disk                   930,5G 
|-/dev/sda1 /dev/sda1 /dev/sda        part ext4   sina-boot   1000M /boot
|-/dev/sda2 /dev/sda2 /dev/sda        part ext4   sina-root1  48,8G /
|-/dev/sda3 /dev/sda3 /dev/sda        part ext4   sina-root2  48,8G /sina-root2
|-/dev/sda4 /dev/sda4 /dev/sda        part                       1K 
|-/dev/sda5 /dev/sda5 /dev/sda        part swap   sina-swap    7,9G [SWAP]
|-/dev/sda6 /dev/sda6 /dev/sda        part vfat   efi-boot     200M /boot/efi
`-/dev/sda7 /dev/sda7 /dev/sda        part ext4   sina-log   823,8G /var/log
  • Description of the issue (ideally so that others can reproduce it):

rear mkbackuponly

Command included the contents of the directories
which are listed in "EXCLUDE_BACKUP" into tarball.
Consequently, the could NOT be found in "backup_excluded.log".
I exspected them to be excluded, which was not the case.

As far as I could find out, "EXCLUDE_BACKUP" will only be used
in "./layout/save/default/340_generate_mointpoint_device.sh"
and for other purposes as exspected.

  • Workaround, if any:

Use "BACKUP_PROG_EXCLUDE+=( ... ) instead.

I would like to suggest to modify the explanation given
in "./conf/default.conf" (lines 2677 + 8) for proper usage
of "EXCLUDE_BACKUP" or the behavior of that array if used
to comply with the description given.

jsmeix commented at 2023-01-03 15:07:

Only FYI:
https://github.com/rear/rear/issues/2772
is a related issue

jsmeix commented at 2023-01-03 15:29:

EXCLUDE_BACKUP is used only in
layout/save/default/340_generate_mountpoint_device.sh
but that script creates the file
$VAR_DIR/recovery/mountpoint_device
(i.e. var/lib/rear/recovery/mountpoint_device)
where things that match EXCLUDE_BACKUP are not added
to var/lib/rear/recovery/mountpoint_device

Then var/lib/rear/recovery/mountpoint_device is used in
backup/NETFS/default/400_create_include_exclude_files.sh
to backup those filesystems that are listed in
var/lib/rear/recovery/mountpoint_device

So as far as I currently understand the code
things in EXCLUDE_BACKUP are not enforced
to be excluded from the backup
instead things in EXCLUDE_BACKUP are only skipped
to be automatically included in the backup.

As far as I see that code parts originated from
https://github.com/rear/rear/commit/1e233be635e047ac5d2777407e3601a713d8fefa

jsmeix commented at 2023-01-03 15:43:

Via
https://github.com/rear/rear/commit/341435c25cfb0072084fcd524519825dfe239e03
I fixed right now the false and misleading comment in
layout/save/default/340_generate_mountpoint_device.sh
from

# Generate the list of mountpoints and devices to exclude from backup

to

# Generate the list of mountpoints and devices to include in the backup
# via backup/NETFS/default/400_create_include_exclude_files.sh
# except those where the mountpoint is in excluded_mountpoints:

jsmeix commented at 2023-01-03 15:47:

Later - provided it is possible for me to understand
what that code actually does with reasonable effort -
I will document what EXCLUDE_BACKUP actually does and
what kind of values EXCLUDE_BACKUP actually needs
in usr/share/rear/conf/default.conf

github-actions commented at 2023-03-05 02:50:

Stale issue message


[Export of Github issue for rear/rear.]