Amanda-Users

Wildcards in disklist--revisited, only using exclusions:

2006-11-09 16:48:45
Subject: Wildcards in disklist--revisited, only using exclusions:
From: "Ian R. Justman" <ianj AT ian-justman DOT com>
To: amanda-users AT amanda DOT org
Date: Thu, 09 Nov 2006 13:41:29 -0800

Hi, all.

To summarize, I'm trying to back up a hashed spool of mailboxes on our mailserver at work. The top directory of that spool has five hundred directories numbered 0-499 and I want to back them up a hundred at a time over the length of the backup process.

The first time I tried, this was according to a suggestion I found in the list archive. The backup failed because it was looking for the "wildcards" as literal parts of the pathname and not actually globbing as it should. For example, if I give "./[0-9]/",it would look for pathnames containing "./[0-9]/" actually in them, not expanding them as the wildcards I expressed them to be. The net result is that the mail spool does not get backed up at all because it cannot find that "pathname". The pathnames are in a file passed to the machine in question, "trillian", then referenced by gtar's --from-file.

This time, I tried using wildcards in exclude lines. Here's my revised disk list entries (the actual directories to be backed up are commented out for reference's sake):

trillian /var/spool/PO/mailbox/0-99 /var/spool/PO/mailbox {
  user-tar
#  include "./[0-9]/" "./[1-9][0-9]/"
  exclude "./[1-4][0-9][0-9]/"
} 1

[...]

trillian /var/spool/PO/mailbox/100-199 /var/spool/PO/mailbox {
  user-tar
#  include "./1[0-9][0-9]/"
  exclude "./[0-9]/" "./[1-9][0-9]/" "./[2-4][0-9][0-9]/"
} 1

[...]

trillian /var/spool/PO/mailbox/200-299 /var/spool/PO/mailbox {
  user-tar
#  include "/.2[0-9][0-9]/"
  exclude "./[0-9]/" "./[1-9][0-9]/" "./[1,3-4][0-9][0-9]/"
} 1

[...]

trillian /var/spool/PO/mailbox/300-399 /var/spool/PO/mailbox {
  user-tar
#   include "./3[0-9][0-9]/"
  exclude "./[0-9]/" "./[1-9][0-9]/" "./[1-2,4][0-9][0-9]/"
} 1

[...]

trillian /var/spool/PO/mailbox/400-499 /var/spool/PO/mailbox {
  user-tar
#  include "./4[0-9][0-9]/"
  exclude "./[0-9]/" "./[1-9][0-9]/" "./[1-3][0-9][0-9]/"
} 1

This time, the directories to be excluded end up in the same type of file as above, but are fed via --exclude-from rather than --from-file. I looked at the /tmp/amanda/sendbackup.*.exclude files and the exclusions are getting in as they should.

However, they're not being PARSED as they should be.

For each stanza, it backs up ALL five hundred directories. For the entire disklist file, it would back up the hierarchy a complete five times. Apparently because it can't find the specified "pathname component(s)" I'm specifying. And I suspect that again, you cannot have wildcards in the --exclude-from file like you can't from the --from-file file. I can't help thinking it's a gtar bug and I can't be sure whether if it's a gtar bug or if it's that way by design, i.e. you can only explicitly give directories or files while forbidding globbing. gtar is taking those two files and interpreting them literally, not performing any globbing as specified.

What am I doing wrong here? All I want to do in each case is limit it to a certain one hundred directories and I'd like to use well-established wildcards/globbing to enumerate them.

Thanks for any help.

--Ian.