duplicity-talk
[Top][All Lists]
Advanced

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

Re: [Duplicity-talk] Avoid following symbolic links


From: Cristian KLEIN
Subject: Re: [Duplicity-talk] Avoid following symbolic links
Date: Wed, 10 Jun 2009 13:34:31 +0200
User-agent: Thunderbird 2.0.0.21 (X11/20090409)

Michael A. Sidenius a écrit :
> 
> Quoting Cristian KLEIN <address@hidden>:
> 
>> Michael A. Sidenius a écrit :
>>> Hi,
>>>
>>> Would it be possible to make Duplicity avoid following symbolic (soft)
>>> links?
>>>
>>> The best solution would of cause be a command line option, but I could
>>> live with a local patched version, if someone could point me to where to
>>> do the change.
>>
>> Without patching, you could run "find -type l" to get all symlinks, then
>> exclude them using --exclude-filelist or --exclude-filelist-stdin.
>>
> Good idea. Thanks for the input. Will be heavy on the processing though,
> since it need to be updated every time I run Duplicity. My general
> Duplicity script has the following syntax:
> 
> duplicity "bla..bla" $INCLUDE_GLOBBING_FILELIST --exclude /  /
> 
> so I have a whole bunch of backup sets in glob files, which I can put in
> the include globbing variable. I have 3T of space, so running find from
> / every time I do a backup of a small subset would be rather overkill,
> IMHO. If Duplicity could exclude the (few) soft links it finds in the
> subset from the glob file, I believe it would be more "light weigth".

You are right. I was looking for the easiest solution which would not
require you to track the patch against duplicity.

In order to achieve this, you should edit selection.py. Use the other
"selection functions" as example. Ideally, you should add a new
selection function, which would look something like:

def nosymfollow_get_sf(self, filename):
  def exclude_sel_func(path):
    if path.issym():
      return 0
    else:
      return None

    sel_func = exclude_sel_func
    return sel_func





reply via email to

[Prev in Thread] Current Thread [Next in Thread]