BackupPC-users

[BackupPC-users] Excludes only at a specific directory depth? (with tar as XferMethod and BackupPC 3.3.0)

2015-09-09 12:00:27
Subject: [BackupPC-users] Excludes only at a specific directory depth? (with tar as XferMethod and BackupPC 3.3.0)
From: Axel Beckert <beckert AT phys.ethz DOT ch>
To: backuppc-users AT lists.sourceforge DOT net
Date: Wed, 9 Sep 2015 17:57:58 +0200
Hi,

besides other machines (Windows, Linux), we're backing up MacOS X
workstations/laptops with BackupPC running on Debian GNU/Linux 8
Jessie (current Debian stable release, i.e. running BackupPC 3.3.0).

Since rsync on Linux can't backup some mac-specific stuff, we're using
the tar XferMethod.

We wan't to exclude some specific directories created by MacOS X in a
user's home directory like Library/Caches, Movies, Music, Pictures,
etc.

This seems easy if the only share we backup is a single user's home
directory (e.g. "/Users/exampleuser/"). Then we can add
e.g. "/Pictures" to the global exclude list and it should be fine.

But we also have cases where machines are multiuser
workstations. There we want to backup at least whole the
"/Users/". And sometimes we even want to backup the whole machine,
i.e. "/".

So we added "/*/Pictures" and "/Users/*/Pictures" to the global
exclude list.

Unfortunately tar (at least GNU tar -- and we're requiring GNU tar
since the bsdtar shipped by MacOS X is quite buggy when it comes to
incremental backups) interprets a "*" in an --exclude option's value
not as "only one directory level" but as "arbitrary amount of
directory levels". (Not explicitly mentioned in GNU tar's manual, but
according to empirical tests.)

This means that excluding "/Users/*/Pictures" will also exclude
"/Users/exampleuser/Work/Projects/ExampleProject/Documentation/Pictures"
which is not intended.

Even worse, adding "/Pictures" to the global exclude blacklist will
exclude "/Users/exampleuser/ExampleProject/Pictures" if the share to
be backed up is "/Users/exampleuser/ExampleProject/".

So I thought, I need to split up the BackupFilesExclude list by
different types of shares:

But I don't seem to be able to do the following:

$Conf{BackupFilesExclude} = {
  '/Users/*/' => [
      '/Pictures',
      '/Movies',
      '/Music',
  ],
  [...]
};

because the keys of BackupFilesExclude seem to be used literally and
not by matching share names since it's only used like

  $conf->{BackupFilesExclude}{$t->{shareName}}

in BackupPC::Xfer::Tar.

Since I expect that I'm not the only one having this kind of issues, I
wonder if anyone has an idea how to...

* ... exclude directories from backup only if they appear at a very
  specific directory depth (usually depth 0, 1 or 2).
  
* ... use wildcards or regexp to match share names with
  BackupFilesExclude?

Other ideas which came up here, but aren't suitable to solve these
kind of issues:

* Using separate shares per user: Defeats the purpose of not having to
  care about each new user on each workstation. Doesn't help with the
  wildcards issue explain above unless we can use share name matching
  in BackupFilesExclude anyways.

* Using rsync: As explained above, MacOS X rsync can sync Apple file
  metadata from MacOS X to MacOS X, but not to Linux. (Last checked
  about two years ago when MacOS X stopped shipping /usr/bin/gnutar.)

                Kind regards, Axel Beckert
-- 
Axel Beckert <beckert AT phys.ethz DOT ch>       support: +41 44 633 26 68
IT Services Group, HPT H 6                  voice: +41 44 633 41 89
Departement of Physics, ETH Zurich
CH-8093 Zurich, Switzerland                http://nic.phys.ethz.ch/

------------------------------------------------------------------------------
Monitor Your Dynamic Infrastructure at Any Scale With Datadog!
Get real-time metrics from all of your servers, apps and tools
in one place.
SourceForge users - Click here to start your Free Trial of Datadog now!
http://pubads.g.doubleclick.net/gampad/clk?id=241902991&iu=/4140
_______________________________________________
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>