Amanda-Users

Re: include/export again

2003-05-24 04:08:07
Subject: Re: include/export again
From: Mathias Körber <mathias AT koerber DOT org>
Date: Sat, 24 May 2003 16:06:14 +0800

--On Saturday, May 24, 2003 03:47:02 AM -0400 Jon LaBadie <jon AT jgcomp DOT com> wrote:

On Sat, May 24, 2003 at 03:26:16PM +0800, Mathias K?rber wrote:
An update:


root@adelphi:/tmp/amanda# cat sendbackup.Imap.20030524151819.include
./imap


I just looked at my ".exclude" files.  The get the multi /'s.  Here is
one.

./dumps/amanda
./tmp
./local/etc/amanda/*/index/*/*/*.tmp
./local/var/amanda/gnutar-lists/*.new

That seems to work only for excludes, as names to exclude
are handed to gnutar unprocessed (almost), while lots of
stuff is being done for includes (apparently to avoid reporting
errors when files are not found)..

I had a look at the source, and in client_util.c
found this in add_include which is called on each line
in the file provided:

        [...]
       char *glob;
       char *regex;
       DIR *d;
       struct dirent *entry;

       glob = ainc+2;
       regex = glob_to_regex(glob);
       if((d = opendir(device)) == NULL) {
           dbprintf(("%s: Can't open disk '%s']\n",
                     debug_prefix(NULL), device));
           if(verbose)
               printf("ERROR [Can't open disk '%s']\n", device);
           return 0;
       }
       else {
           while((entry = readdir(d)) != NULL) {
               if(is_dot_or_dotdot(entry->d_name)) {
                   continue;
               }
               if(match(regex, entry->d_name)) {
                   fprintf(file_include, "./%s\n", entry->d_name);
                   nb_exp++;
               }
           }
       }
        [...]

what this seems to do is to convert each line(glob) to a gnutar
regex. It then reads the disk directory (/var) and compares each
entry with the given regex. If it is found it is included in the combined
list.

Obviously reading /var only cannot find ./spool/imap
as only ./spool will get found which will not match.

May need to add some code to check whether a multi-/ name
exists exactly as given and let that through too.
Anythoughts on whether that will break anything?



jl
--
Jon H. LaBadie                  jon AT jgcomp DOT com
 JG Computing
 4455 Province Line Road        (609) 252-0159
 Princeton, NJ  08540-4322      (609) 683-7220 (fax)







<Prev in Thread] Current Thread [Next in Thread>