From: Craig B. <cr...@at...> - 2002-06-20 06:17:35
|
> This is a followup to the problems I've been having when the /proc > directory wasn't excluded, and the trouble I've been having getting it > excluded. > > I finally got it to exclude the directories. Even after upgrading to > the latest alpha (good job and thanks BTW), it still wasn't excluding my > directories properly. I found that it was passing the options to tar > fine, but tar wasn't excluding them. It turns out that you shouldn't > put any path information in - by telling it to just exclude "proc" I was > able to get it to work. The problem is, any files named proc, dev, or > tmp will not be backed up as well. Any ideas on workarounds? Thanks. Hmmm, I'd like to get to the bottom of this before I release 1.5.0. First off, BackupPC will run a command basically like: tar -c -v -f - -C / . so all the paths should start with "./". Therefore your exclude file should be "./proc" or "./tmp". This will do the right thing, since the exclude option is required to be a complete part of a path. To really be sure you need GNU tar version 1.13.20 or higher. It has an option --anchored which anchors the --exclude option to the start of the path. (See http://www.funet.fi/pub/gnu/alpha/gnu/tar to get the latest tar-1.13.25.tar.gz.) Here's an example: mkdir test cd test mkdir proc proc2 other. other./proc touch proc/xxx proc2/yyy other./proc/zzz With tar 1.13.19: tar -c -f - . --exclude=proc | tar tvf - drwxr-xr-x craig/wheel 0 2002-06-19 22:59:51 ./ drwxr-xr-x craig/wheel 0 2002-06-19 23:00:07 ./proc2/ -rw-r--r-- craig/wheel 0 2002-06-19 23:01:41 ./proc2/yyy drwxr-xr-x craig/wheel 0 2002-06-19 23:01:37 ./other./ Notice proc and other./proc are excluded, which is wrong. Next, again with tar 1.13.19: tar -c -f - . --exclude=./proc | tar tvf - drwxr-xr-x craig/wheel 0 2002-06-19 22:59:51 ./ drwxr-xr-x craig/wheel 0 2002-06-19 23:00:07 ./proc2/ -rw-r--r-- craig/wheel 0 2002-06-19 23:01:41 ./proc2/yyy drwxr-xr-x craig/wheel 0 2002-06-19 23:01:37 ./other./ drwxr-xr-x craig/wheel 0 2002-06-19 23:01:41 ./other./proc/ -rw-r--r-- craig/wheel 0 2002-06-19 23:01:41 ./other./proc/zzz This is the correct behavior: ./proc is excluded but ./other./proc is not. Finally, you can get the same result with tar 1.13.25 using --anchored: navajo 1690% tar -c -f - . --anchored --exclude=./proc | tar tvf - drwxr-xr-x craig/wheel 0 2002-06-19 22:59:51 ./ drwxr-xr-x craig/wheel 0 2002-06-19 23:00:07 ./proc2/ -rw-r--r-- craig/wheel 0 2002-06-19 23:01:41 ./proc2/yyy drwxr-xr-x craig/wheel 0 2002-06-19 23:01:37 ./other./ drwxr-xr-x craig/wheel 0 2002-06-19 23:01:41 ./other./proc/ -rw-r--r-- craig/wheel 0 2002-06-19 23:01:41 ./other./proc/zzz If you have tar version >= 1.3.20 then you can add --anchored to $Conf{TarClientCmd}. It is possible that --anchored is not necessary and simply making sure your excludes start with "./" is sufficient. I'd need to look at the source for tar to be sure. Please tell us if "./proc" works, then I can close out this issue for the documentation. Craig |