[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Mixing include and exclude patterns in tarsnap.conf



Bob Williams <linux@barrowhillfarm.org.uk> wrote:

> 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?"

Bob, I don't have an answer to your specific question - I don't really use
those options.

However, have you considered using the nodump flag? I use this, and
feel it's neater. It's more fine grained, and I can tell from an ls -ol
which files are backed up or not without having to search through conf files.
(though of course, a nodump on a directory also covers everything below
is, so files/directories don't necessarily need nodump directly)

So, to use your above case as an example, add option '--nodump' to
the tarsnap command, after first doing:

BSD:
chflags -R nodump /etc
chflags -R dump /etc/crontab /etc/fstab /etc/HOSTNAME /etc/hosts /etc/mdadm.conf /etc/mpd.conf /etc/sudoers /etc/vimrc /etc/ssh
ls -lao (To view)

Linux: (I think)
chattr -R +d /etc
chattr -dR /etc/crontab /etc/fstab /etc/HOSTNAME /etc/hosts /etc/mdadm.conf /etc/mpd.conf /etc/sudoers /etc/vimrc /etc/ssh
lsattr (To view)

(The second -R is needed in this case to make sure everything under
/etc/ssh/ is made dumpable - as we've previously just marked every
file/directory as nodump)

You can even put the above in your script before running tarsnap if you
want to ensure the flags are as you expect at backup time (e.g. nothing
missed due to a file being deleted and replaced etc. and the dump flag
lost or undeterminable)

Finally, as I mentioned, 'nodump' on directories covers everything below
it, so if (say) you wanted to backup everything under /var except /var/tmp
setting the nodump flag only on /var/tmp and backing up /var would surfice.

I know this doesn't specifically answer your question, but it's another
way to approach things!

Cheers, Jamie