[Box Backup] Following Symbolic Links
Ben Summers
boxbackup@fluffy.co.uk
Thu, 15 Jun 2006 20:59:27 +0100
On 15 Jun 2006, at 20:38, Martin Ebourne wrote:
> On Thu, 2006-06-15 at 11:51 -0600, Peter Porter wrote:
>> Gentoo links several important config files under /etc to a place
>> in the
>> portage tree, under /usr/portage/. Certainly a bad assumption of
>> me not
>> to check the entire directory structure to be sure, but in looking
>> for a
>> solution the cleanest option (in my opinion) would be to have a
>> follow
>> symlinks option.
>
> How should such an option work?
>
[big snip of sensible stuff]
>
>> I can certainly see the general design benefit of backing files up as
>> they exist on the unix filesystem, but given this situation I see why
>> the option was added to tar, and I don't see a clean method to
>> guarantee
>> that everything that logically falls under the /etc folder is
>> backed up.
>
> I don't think this really has anything to do with design benefits, but
> simply a backup system should restore you to the state where you were
> before you needed it. (If only insurance really did this!) If it
> backed
> up the files behind the symlinks instead of the symlinks it would
> not be
> doing this.
Which is why it works the way it does. And I don't believe in giving
options where there isn't two equally valid and useful alternatives.
>
> I can think of a third alternative which might be better. It would be
> possible to back up both the symlink and the file behind it at its
> symlink location. Thus you could restore the symlinks but also access
> the data behind it. I suspect this would be complicated to implement
> (including the tests), potentially confusing to operate (although I
> think that is surmountable) but utterly useless if someone symlinked a
> directory rather than a file. I've no idea if Ben would be prepared to
> accept such a patch if someone who was experiencing this problem was
> prepared to write it.
I don't think I would. Users should do things correctly or not at
all. I do think the option of logging when there are symlinks
pointing outside the store might be useful, so I'd be happy to add
that. But then, do people look at their logs enough?
Perhaps bbackupctl should have an option to show the status of all
locations:
$ bbackupctl status
etc: OK, 2006-06-15T00:13:02 (5 hours ago), symlinks pointing
outside store
home: In progress, 2006-06-14T00:13:02 (1 day ago)
old_stuff: Due for removal
or something like that. Then we can encourage people to add it to
their daily status report email.
Ben