#216 Issue closed: Excluding a folder in a rear backup

cocampbe opened issue at 2013-03-27 13:47:

I've been perusing the docs and have not come up with a solution yet. I am trying to exclude a folder that contains a large amount of logs. Here is what I have in the local.conf.

ONLY_INCLUDE_VG=( VolGroup00 )
EXCLUDE_COMPONENTS=( "fs:/usr/openv/logs/nbftsrvr" )

So far this does not work. I am not sure if the order matters, or if I am using the wrong exclude directive. Any insight is greatly appreciated.

jhoekx commented at 2013-03-27 13:51:

EXCLUDE_COMPONENTS only works for real system components like filesystems or logical volumes. If you just want to exclude a directory you have to use the BACKUP_PROG_EXCLUDE array.

cocampbe commented at 2013-03-27 13:53:

Cool. I will do that. I was about to try that, but I just wasn't sure. I also thought about just trying EXCLUDE_MOUNTPOINTS even though it technically is not.

jhoekx commented at 2013-03-27 14:07:

Can you show us the local.conf you're using? To make sure the BACKUP_PROG_EXCLUDE syntax is OK.

cocampbe commented at 2013-03-27 14:09:

Holding off for a sec. I may have spoken too soon.

cocampbe commented at 2013-03-27 14:11:

OUTPUT=ISO
BACKUP=NETFS
BACKUP_URL="nfs://some_server/rear/"
NETFS_KEEP_OLD_BACKUP_COPY=1
ONLY_INCLUDE_VG=( VolGroup00 )
BACKUP_PROG_EXCLUDE=( /usr/openv/logs/nbftsrvr )

cocampbe commented at 2013-03-27 14:14:

I just added single quotes to BACKUP_PROG_EXCLUDE=( '/usr/openv/logs/nbftsrvr' ). trying again.

jhoekx commented at 2013-03-27 14:19:

The line is not entirely correct. It should be:

BACKUP_PROG_EXCLUDE=( "${BACKUP_PROG_EXCLUDE[@]}" '/usr/openv/logs/nbftsrvr' )

You could also try running rear with the -d switch. In you /tmp/rear-XXX/ folder should be a backup-exclude.txt file. It's in tar exclude syntax. That's an interesting file to share.

cocampbe commented at 2013-03-27 14:22:

I checked the file and it contains /usr/openv/logs/nbftsrvr.

jhoekx commented at 2013-03-27 14:26:

The file is sent to tar as-is. Maybe try /usr/openv/logs/nbftsrvr/*?

cocampbe commented at 2013-03-27 14:31:

File is now showing /usr/openv/logs/nbftsrvr/*. I am running rear again.

cocampbe commented at 2013-03-27 14:42:

Did not work.

cocampbe commented at 2013-03-27 14:53:

I just tailed the backup.log file and saw that it is not copying those files. So it is working. Looks like I may be backing up something else that is making the archive rather large. Thanks for your help.

cocampbe commented at 2013-03-27 15:00:

Yep. even though I have ONLY_INCLUDE_VG=( VolGroup00 ), it was backing up a san attached volume. I added it to the exclude list.


[Export of Github issue for rear/rear.]