BackupPC-users

Re: [BackupPC-users] $Conf{BackupFilesExclude}?

2009-12-01 10:49:11
Subject: Re: [BackupPC-users] $Conf{BackupFilesExclude}?
From: Craig Barratt <cbarratt AT users.sourceforge DOT net>
To: <chrischan AT knebb DOT de>
Date: Tue, 1 Dec 2009 07:46:01 -0800
Christian writes:

> But it backs up all .vmdk files from the excluded directory above....

This is due to the behavior of smbclient.  Here's an explanation
of how to make it work.

Craig

---------- Forwarded message ----------
To:   obj AT jltechinc DOT com <obj AT jltechinc DOT com>
From: Craig Barratt <cbarratt AT users.sourceforge DOT net>
Cc:   General list for user discussion,
      questions and support <backuppc-users AT lists.sourceforge DOT net>
Date: Sun, 12 Apr 2009 23:56:00 -0700
Subj: Re: [BackupPC-users] Next release 

Obj writes:

> I am running version 3.2.0. can someone tell me why
> $Conf{BackupFilesExclude} is not working. It still backups up all Temp
> folders, and .mp3 files, etc. The backup method is SMB.

You sent me offlist your config file and XferLOG file.  Thanks.

The problem is that if you use wildcards (in particular "*") in
excludes, smbclient will only do the right thing if you use the
Windows-style directory separator '\' instead of '/'.

Therefore, instead of using something like this:

    $Conf{BackupFilesExclude} = {
      '*' => [
        '/Documents and Settings/*/Local Settings/Temporary Internet Files/',
        '/Documents and Settings/*/Local Settings/Temp/',
        '/Documents and Settings/*/NTUSER.DAT',
        '/Documents and Settings/*/ntuser.dat.LOG',
      ],
    };

you should use this:

    $Conf{BackupFilesExclude} = {
      '*' => [
        '\\Documents and Settings\\*\\Local Settings\\Temporary Internet Files',
        '\\Documents and Settings\\*\\Local Settings\\Temp',
        '\\Documents and Settings\\*\\NTUSER.DAT',
        '\\Documents and Settings\\*\\ntuser.dat.LOG',
      ],
    };

Also, you shouldn't include the trailing \ at the end of a
directory path.  You should either use:

    '\\FOO'

or

    '\\FOO\\*'

The first will exclude \FOO and all its contents.  The latter will
include the directory \FOO but similarly exclude its contents.

You can experiment with what works or doesn't work by manually
running smbclient, eg:

    setenv PASSWD XXXXXXX
    /usr/bin/smbclient \\\\HOST\\SHARE -I IPADDR -U USERNAME -E -N -d 1 \
            -c tarmode\ full -TcrX - \
            \\Documents\ and\ Settings\\\*\\Local\ Settings\\Temporary\ 
Internet\ Files \
            \\Documents\ and\ Settings\\\*\\Local\ Settings\\Temp \
            \\Documents\ and\ Settings\\\*\\NTUSER.DAT \
            \\Documents\ and\ Settings\\\*\\ntuser.dat.LOG \
        | tar tvf -

Note the additional escaping for the shell.  (Also, the -I IPADDR is
optional depending on your configuration.)

Craig

------------------------------------------------------------------------------
Join us December 9, 2009 for the Red Hat Virtual Experience,
a free event focused on virtualization and cloud computing. 
Attend in-depth sessions from your desk. Your couch. Anywhere.
http://p.sf.net/sfu/redhat-sfdev2dev
_______________________________________________
BackupPC-users mailing list
BackupPC-users AT lists.sourceforge DOT net
List:    https://lists.sourceforge.net/lists/listinfo/backuppc-users
Wiki:    http://backuppc.wiki.sourceforge.net
Project: http://backuppc.sourceforge.net/

<Prev in Thread] Current Thread [Next in Thread>
  • Re: [BackupPC-users] $Conf{BackupFilesExclude}?, Craig Barratt <=