|
|
| |
# Subtree pruning | # Subtree pruning |
# A space-separated list of directories to prune from each backup. | # A space-separated list of directories to prune from each backup. |
# Key is a filesystem or host:dir spec as outlined above |
# Key is a filesystem or host:dir spec as outlined above. |
# regular expressions allowed (not shell-type wildcards!) |
# Regular expressions are allowed (not shell-type wildcards!) |
# | # |
# Note: These directories are actually regular expressions and must |
# Note: These "directories" are actually regular expressions and must |
# match "find" output relative to the path of the current backup set. This | # match "find" output relative to the path of the current backup set. This |
# means that different exclusions are needed for different backup sets. | # means that different exclusions are needed for different backup sets. |
# This is a little tricky, so, read on. | # This is a little tricky, so, read on. |
|
|
# | # |
# then, the constructed -regex argument to "find" looks like this | # then, the constructed -regex argument to "find" looks like this |
# | # |
# -regex "\./\(one\|two\|three\)/.*" |
# -regex "\./(one|two|three)" |
# | # |
# The last thing you need to know is that FlexBackup only uses the prune |
# (with characters escaped as necessary depending on your environment). |
|
# |
|
# Another thing you need to know is that FlexBackup only uses the prune |
# terms that match the current base directory in the set you're backing | # terms that match the current base directory in the set you're backing |
# up. For example, if your backup set definition looks like this | # up. For example, if your backup set definition looks like this |
# | # |
|
|
# | # |
# $prune{'/'} = "home/bert home/ernie var/tmp"; | # $prune{'/'} = "home/bert home/ernie var/tmp"; |
# | # |
# does not work, unless, of course, your backup set is backing up "/", |
# doesn't work, unless, of course, your backup set is backing up "/", |
# which our example is not. | # which our example is not. |
# | # |
|
# Many other complex and abstruse variations are possible. Here's one |
|
# interesting corner case. If you want to preserve a directory but none of its |
|
# contents, you can do it. Picking on ernie from our previous example, preserve |
|
# only his home directory: |
|
# |
|
# $prune{'/home'} = "ernie/.*"; |
|
# |
$prune{'/'} = "tmp proc"; | $prune{'/'} = "tmp proc"; |
| |
# Compression | # Compression |
|
|
# Matches paths, not filenames, so put .* on the front/back as needed. | # Matches paths, not filenames, so put .* on the front/back as needed. |
# Comment these out to exclude nothing. | # Comment these out to exclude nothing. |
# | # |
# Note: The first example line breaks portage in a restored backup because |
# Gentoo note: The first example line breaks portage in a restored backup |
# "/usr/lib/portage/pym/cache" is not backed up. Way too general! The moral |
# because "/usr/lib/portage/pym/cache" is not backed up. Way too general! |
# of this story is, be very careful with global excludes. The second example |
# The moral of this story is, be very careful with global excludes. The |
# is probably okay. |
# second example is probably okay. |
# $exclude_expr[0] = '.*/[Cc]ache/.*'; | # $exclude_expr[0] = '.*/[Cc]ache/.*'; |
# $exclude_expr[1] = '.*~$'; | # $exclude_expr[1] = '.*~$'; |
| |