forked from gentoo/gentoo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
flexbackup-1.2.1-prune.patch
136 lines (131 loc) · 5.41 KB
/
flexbackup-1.2.1-prune.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
diff -ub flexbackup-old/flexbackup flexbackup-new/flexbackup
--- flexbackup-old/flexbackup 2007-05-11 20:14:13.000000000 -0400
+++ flexbackup-new/flexbackup 2007-05-11 20:22:36.000000000 -0400
@@ -3085,7 +3085,6 @@
$::read_cmd = "$bufcmd $read_flags";
} elsif ($cfg::buffer eq "mbuffer") {
-
$::path{'mbuffer'} = &checkinpath('mbuffer');
push(@::remoteprogs, $::path{'mbuffer'});
@@ -3101,7 +3100,6 @@
}
}
} else {
-
# If buffering disabled, use dd or cat depending on if blocking turned off on not
if ($cfg::blksize eq '0') {
$::buffer_cmd = "";
@@ -4887,18 +4885,19 @@
my $rex;
# FreeBSD needs -E (above) and no backslashes around the (|) chars
if ($::uname =~ /FreeBSD/) {
- $rex = '-regex "\./(';
+ $rex = '"\./(';
$rex .= join('|', keys %{$::prune{$prunekey}});
- $rex .= ')/.*" ';
+ $rex .= ')"';
} else {
- $rex = '-regex "\./\(';
+ $rex = '"\./\(';
$rex .= join('\|', keys %{$::prune{$prunekey}});
- $rex .= '\)/.*" ';
+ $rex .= '\)"';
}
# Show what the darn thing is constructing for prune expressions.
- &log("| \"find\" regex for pruning is: $rex");
- $cmd .= $rex;
- $cmd .= '-prune -o ';
+ &log("| \"find\" regex for pruning is:");
+ &log("| $rex");
+ &line();
+ $cmd .= '-regex ' . $rex . ' -prune -o ';
} else {
# Show what the darn thing is constructing for prune expressions.
&log("| No pruning defined for this tree.");
diff -ub flexbackup-old/flexbackup.1 flexbackup-new/flexbackup.1
--- flexbackup-old/flexbackup.1 2007-05-11 20:14:13.000000000 -0400
+++ flexbackup-new/flexbackup.1 2007-05-11 20:09:58.000000000 -0400
@@ -48,7 +48,7 @@
Extract (restore) the files listed in text file \(dqfilelist\(dq into your
current working directory.
.TP
-\fBflexbackup\fR \fI-extract\fR \fI-flist\fR <\fIfilename\fR>
+\fBflexbackup\fR \fI-extract\fR \fI-onefile\fR <\fIfilename\fR>
Extract (restore) the single file named \(dqfilename\(dq into your current
working directory.
.TP
diff -ub flexbackup-old/flexbackup.conf flexbackup-new/flexbackup.conf
--- flexbackup-old/flexbackup.conf 2007-05-11 20:14:13.000000000 -0400
+++ flexbackup-new/flexbackup.conf 2007-05-11 20:26:48.000000000 -0400
@@ -28,10 +28,10 @@
# Subtree pruning
# A space-separated list of directories to prune from each backup.
-# Key is a filesystem or host:dir spec as outlined above
-# regular expressions allowed (not shell-type wildcards!)
+# Key is a filesystem or host:dir spec as outlined above.
+# 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
# means that different exclusions are needed for different backup sets.
# This is a little tricky, so, read on.
@@ -46,9 +46,11 @@
#
# 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
# up. For example, if your backup set definition looks like this
#
@@ -66,9 +68,16 @@
#
# $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.
#
+# 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";
# Compression
@@ -138,10 +147,10 @@
# Matches paths, not filenames, so put .* on the front/back as needed.
# Comment these out to exclude nothing.
#
-# Note: The first example line breaks portage in a restored backup because
-# "/usr/lib/portage/pym/cache" is not backed up. Way too general! The moral
-# of this story is, be very careful with global excludes. The second example
-# is probably okay.
+# Gentoo note: The first example line breaks portage in a restored backup
+# because "/usr/lib/portage/pym/cache" is not backed up. Way too general!
+# The moral of this story is, be very careful with global excludes. The
+# second example is probably okay.
# $exclude_expr[0] = '.*/[Cc]ache/.*';
# $exclude_expr[1] = '.*~$';
diff -ub flexbackup-old/flexbackup.conf.5 flexbackup-new/flexbackup.conf.5
--- flexbackup-old/flexbackup.conf.5 2007-05-11 20:14:13.000000000 -0400
+++ flexbackup-new/flexbackup.conf.5 2007-05-11 20:09:58.000000000 -0400
@@ -40,7 +40,9 @@
\fB$prune{\fI'/'\fR}\fR = \fI'tmp proc'\fR;
Configure subtree pruning. A space-separated list of directories to prune from
each backup. Key is a filesystem/directory or \(dqhost:directory\(dq spec as
-outlined above regular expressions allowed (not shell-type wildcards!).
+outlined above. Regular expressions allowed (not shell-type wildcards!). There
+is additional explanation (and a lot of examples) in the provided configuration
+file.
.TP
\fB$compress\fR = \fI'false|gzip|bzip2|lzop|zip|compress|hardware'\fR;
.TQ