Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BACKUP_PROG_EXCLUDE not working with BACKUP=NBU #2066

Closed
flechoide opened this issue Mar 5, 2019 · 6 comments
Closed

BACKUP_PROG_EXCLUDE not working with BACKUP=NBU #2066

flechoide opened this issue Mar 5, 2019 · 6 comments
Assignees
Labels
external tool The issue depends on other software e.g. third-party backup tools. needs sponsorship This issue will not get solved on a voluntary base by ReaR upstream. support / question

Comments

@flechoide
Copy link

flechoide commented Mar 5, 2019

  • ReaR version ("/usr/sbin/rear -V"): Relax-and-Recover 2.1-git201706071007 / 2017-06-07

  • OS version ("cat /etc/rear/os.conf" or "lsb_release -a" or "cat /etc/os-release"):

OS_VENDOR=RedHatEnterpriseServer
OS_VERSION=7

LSB Version:    :core-4.1-amd64:core-4.1-noarch
Distributor ID: RedHatEnterpriseServer 
Description:    Red Hat Enterprise Linux Server release 7.3 (Maipo)
Release:        7.3
Codename:       Maipo
  • ReaR configuration files ("cat /etc/rear/site.conf" and/or "cat /etc/rear/local.conf"):
    See below

  • Hardware (PC or PowerNV BareMetal or ARM) or virtual machine (KVM guest or PoverVM LPAR):
    physical machine, del poweredge

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

Hello ,
Im stuck trying to exclude directories (not whole filesystems) from one of our backup media servers, I need that in order to get the iso file smaller, so I put into my local.conf :
BACKUP_PROG_EXCLUDE=( ${BACKUP_PROG_EXCLUDE[@]} '/usr/openv/netbackup/client/*' '/usr/openv/pack/*' '/usr/openv/logs/*' )

But when I launch rear I get that output :

2019-03-05 12:20:24 Files being excluded: dev/shm dev/oracleasm dev/.udev dev/shm/* /etc/pki/tls/private /etc/pki/CA/private /etc/pki/nssdb/key*.db /us /openv/netbackup/bin/xbp

So it seems like he is not excluding the sub-folders

Not sure if its related but /usr/openv is a filesystem mount

root@DELZP042-PRO:/root# df -Ph /usr/openv/ 
Filesystem               Size  Used Avail Use% Mounted on 
/dev/mapper/vg00-lv_nbu   20G  6.9G   12G  37% /usr/openv

My local.conf :

OUTPUT=ISO 
BACKUP=NBU
COPY_AS_IS_NBU=( /usr/openv  /opt/VRTSpbx   /etc/vx   /etc/init.d/vxpbx_exchanged  )                                                                                                                                                                                                                                                                                                                                                                                                                                          ONLY_INCLUDE_VG=("vg00") 
PROGS_NBU=( ) 
PROGS=( "${PROGS[@]}" /bin/ping6   /usr/bin/telnet )                                                                                                                                                                                                                     BACKUP_PROG_EXCLUDE=( ${BACKUP_PROG_EXCLUDE[@]} '/usr/openv/netbackup/client/*' /usr/openv/pack/*' '/usr/openv/logs/*' )
ISO_DIR=/rear/DELZP042 
export TMPDIR=/rear/DELZP042
@flechoide flechoide changed the title Help BACKUP_PROG_EXCLUDE Help BACKUP_PROG_EXCLUDE not working Mar 5, 2019
@jsmeix jsmeix added support / question needs sponsorship This issue will not get solved on a voluntary base by ReaR upstream. external tool The issue depends on other software e.g. third-party backup tools. labels Mar 5, 2019
@jsmeix
Copy link
Member

jsmeix commented Mar 5, 2019

I do not use NBU (Symantec/Veritas NetBackup)
because I do not have any kind of proprietary software
like third-party backup tools but I assume
BACKUP_PROG_EXCLUDE is not supported for BACKUP=NBU
because this are the only ReaR scripts that use BACKUP_PROG_EXCLUDE

# find usr/share/rear -name '*.sh' | xargs grep -l "BACKUP_PROG_EXCLUDE"
usr/share/rear/layout/save/default/320_autoexclude.sh
usr/share/rear/backup/RSYNC/default/400_create_include_exclude_files.sh
usr/share/rear/backup/TSM/default/400_create_include_exclude_files.sh
usr/share/rear/backup/NETFS/default/400_create_include_exclude_files.sh
usr/share/rear/backup/YUM/default/400_create_include_exclude_files.sh
usr/share/rear/backup/BORG/default/400_create_include_exclude_files.sh

See the BACKUP SOFTWARE INTEGRATION section in man rear
https://github.com/rear/rear/blob/master/doc/rear.8.adoc

See also usr/share/rear/conf/default.conf (excerpts)

# Internal BACKUP stuff
##
# These settings apply to all cases of internal Relax-and-Recover backup
...
# BACKUP_PROG_EXCLUDE is an array of strings that get written into a backup-exclude.txt file
# that is used e.g. in 'tar -X backup-exclude.txt' to get things excluded from the backup.

but you do not use a ReaR internal backup method but
the third-party BACKUP=NBU method, see also the section about
"Relax-and-Recover versus backup and restore" in
https://en.opensuse.org/SDB:Disaster_Recovery

@jsmeix jsmeix changed the title Help BACKUP_PROG_EXCLUDE not working BACKUP_PROG_EXCLUDE not working with BACKUP=NBU Mar 5, 2019
@flechoide
Copy link
Author

flechoide commented Mar 5, 2019

Hello, thanks for the reply, I realized here I have a defined variables with the paths :

root@DELZP042-PRO:/root# grep -Ri logs /usr/share/rear/* \| grep NBU 
/usr/share/rear/conf/default.conf:COPY_AS_IS_EXCLUDE_NBU=( "/usr/openv/netbackup/logs/*" "/usr/openv/netbackup/bin/bpjava*" "/usr/openv/netbackup/bin/xbp" '/usr/openv/netbackup/client/*' '/usr/openv/pack/*'  )
/usr/share/rear/conf/examples/RHEL6-NETFS-of-NBU-master-example.conf:BACKUP_PROG_EXCLUDE=( "${BACKUP_PROG_EXCLUDE[@]}" '/usr/openv/tmp/*' '/nbu/logs/openv/logs/nbdisco/*' '/nbu/logs/openv/logs/nbsvcmon/*' '/nbu/lo gs/openv/logs/nbrmms/*' '/nbu/logs/openv/logs/nbsl/*' ) 

So I have edited this file the /usr/share/rear/conf/default.conf and I placed the directories I wanted to exclude, now it seems to be working .

May I ask if I can append those directories from my os.conf or my local.conf in some way since I understand the file /usr/share/rear/conf/default.conf is not supposed to be modified

@gdha
Copy link
Member

gdha commented Mar 5, 2019

If you add these variables in the /etc/rear/local.conf file then they will over-rule the ones defined in the default.conf file

@gdha gdha self-assigned this Mar 5, 2019
@flechoide
Copy link
Author

flechoide commented Mar 6, 2019

I realize that syntax is bash ?? Its an asociative array ?? If I do in my local.conf

COPY_AS_IS_EXCLUDE_NBU=( ${COPY_AS_IS_EXCLUDE_NBU[@]}  "/usr/openv/netbackup/logs/*" "/usr/openv/netbackup/bin/bpjava*" "/usr/openv/netbackup/bin/xbp" '/usr/openv/netbackup/client/*' '/usr/openv/pack/*'  )

I understand it will work as expected

@jsmeix
Copy link
Member

jsmeix commented Mar 6, 2019

@flechoide
basically all in ReaR is bash, also config files
are sourced and executed as bash scipts.

Normally ReaR does not use associative arrays - only indexed arrays.
But I know nothing about how NBU stuff is implemented in ReaR.

In general COPY_AS_IS variables mean totally different things
than backup related stuff - but I know nothing about NBU and
how NBU stuff is implemented in ReaR.

@flechoide
Copy link
Author

Ok, I understand, I thank you all for the help, finally I was able to implement the backup and it worked as expected with the COPY_AS_IS_EXCLUDE_NBU variable into the local.conf file from /etc/rear .

Please the case can be closed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
external tool The issue depends on other software e.g. third-party backup tools. needs sponsorship This issue will not get solved on a voluntary base by ReaR upstream. support / question
Projects
None yet
Development

No branches or pull requests

3 participants