[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Mixing include and exclude patterns in tarsnap.conf
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
I want to back up the whole of my /home/user directory, excluding a
selection of subfolders, but *including* a few config files in /etc.
My tarsnap.conf file looks like this:
### User specific options for tarsnap
### These options override any set in
### /usr/local/etc/tarsnap.conf
# Tarsnap cache directory
cachedir /home/bob/../tarsnap/tarsnap-cache
keyfile /home/bob/../tarsnap.key
# Exclude files and directories matching specified patterns
exclude /home/bob/AlbumBrowser
exclude /home/bob/Channel 23 Ltd
exclude /home/bob/DaveTemp
exclude /home/bob/DaveTransfer
exclude /home/bob/DaveVideo
exclude /home/bob/Documents/pgp
[...]
# Include only files and directories matching specified patterns
include /etc/crontab
include /etc/fstab
include /etc/HOSTNAME
include /etc/hosts
include /etc/mdadm.conf
include /etc/mpd.conf
include /etc/sudoers
include /etc/vimrc
include /etc/ssh
The command I'm using is:
sudo tarsnap --dry-run --print-stats -v -c -f bhf-bob-`date
+\%Y-\%m-\%d` /home/bob /etc
but the output is just the --print-stats stuff:
bob@barrowhillfarm:~> sudo tarsnap --dry-run --print-stats -v -c -f
bhf-bob-`date +\%Y-\%m-\%d` /home/bob /etc
Total size Compressed size
All archives 40334809966 38211678307
(unique data) 39263792675 37158355424
This archive 1489 1356
New data 1489 1356
If I remove all those include directives, then it runs as I expect,
lots of lines beginning with 'a', and apparently backing up all the
non-excluded stuff in /home/bob (which is what I want) and the whole
of /etc (which I don't want). I could add exclude lines for everything
in /etc *except* those include lines above, but that seems
inefficient, and begs the question "what are the include patterns for?"
Could someone help me get my head around this, please?
Bob
- --
Bob Williams
System: Linux 3.11.10-11-desktop
Distro: openSUSE 13.1 (x86_64) with KDE Development Platform: 4.13.2
Uptime: 06:00am up 13 days 11:36, 3 users, load average: 0.07, 0.06, 0.05
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.22 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
iEYEARECAAYFAlOlp1UACgkQ0Sr7eZJrmU69WwCfbaXrQbwPwvPjvXEKa9CTjDAk
B20An3V+pKOM6PkY0FBD7xT/qTyGII+L
=+Oi+
-----END PGP SIGNATURE-----