- Incorporated latest patch set into flexbackup

- Stylistic changes made to Makefile

PR:		ports/125905
Submitted by:	Marcus von Appen <mva@sysfault.org> (maintainer)
Approved by:	beech@ (mentor)
This commit is contained in:
glarkin
2008-07-30 21:02:40 +00:00
parent 56c8ec312a
commit 0ecc8f5a27
8 changed files with 661 additions and 45 deletions
+11 -18
View File
@@ -7,7 +7,7 @@
PORTNAME= flexbackup
PORTVERSION= 1.2.1
PORTREVISION= 2
PORTREVISION= 3
CATEGORIES= sysutils
MASTER_SITES= http://www.edwinh.org/flexbackup/tarball/ \
http://www.reynoldsnet.org/flexbackup/tarball/
@@ -15,19 +15,17 @@ MASTER_SITES= http://www.edwinh.org/flexbackup/tarball/ \
MAINTAINER= mva@sysfault.org
COMMENT= Perl-based flexible backup system that can use dump/afio/cpio/tar/star
MAKE_ARGS= PERLPATH=${PERL} CONFDIR=${PREFIX} \
CONFFILE=${PREFIX}/etc/flexbackup.conf
CONFDIR= ${PREFIX}
MAKE_ARGS= PERLPATH=${PERL} CONFFILE=${PREFIX}/etc/flexbackup.conf
USE_PERL5= yes
PKGMESSAGE= ${WRKDIR}/pkg-message
SUB_FILES+= pkg-message
OPTIONS= AFIO "Enable afio support" Off \
BUFFER "Enable buffer support" Off \
MBUFFER "Enable mbuffer support" Off \
STAR "Enable star support" Off \
ZIP "Eanble zip support" Off
ZIP "Enable zip support" Off
.include <bsd.port.pre.mk>
@@ -69,22 +67,17 @@ post-patch:
@${REINPLACE_CMD} -e 's|%%TAR_CMD%%|'${TAR_CMD}'|g' \
${WRKSRC}/flexbackup.conf
post-configure:
@${SED} -e 's|%%PREFIX%%|${PREFIX}|g' -e 's|%%CONFDIR%%|${CONFDIR}|g' \
${.CURDIR}/pkg-message > ${PKGMESSAGE}
do-install:
${INSTALL_SCRIPT} ${WRKSRC}/fb.install ${PREFIX}/bin/flexbackup
${INSTALL_DATA} ${WRKSRC}/flexbackup.conf ${PREFIX}/etc/flexbackup.conf.sample
${INSTALL_MAN} ${WRKSRC}/flexbackup.1 ${MAN1PREFIX}/man/man1
${INSTALL_MAN} ${WRKSRC}/flexbackup.conf.5 ${MAN5PREFIX}/man/man5
@${INSTALL_SCRIPT} ${WRKSRC}/fb.install ${PREFIX}/bin/flexbackup
@${INSTALL_DATA} ${WRKSRC}/flexbackup.conf ${PREFIX}/etc/flexbackup.conf.sample
@${INSTALL_MAN} ${WRKSRC}/flexbackup.1 ${MAN1PREFIX}/man/man1
@${INSTALL_MAN} ${WRKSRC}/flexbackup.conf.5 ${MAN5PREFIX}/man/man5
DOCLIST= CHANGES CREDITS README TODO faq.html
post-install:
.if !defined(NOPORTDOCS)
@${MKDIR} ${DOCSDIR}
.for docfile in CHANGES CREDITS README TODO faq.html
${INSTALL_DATA} ${WRKSRC}/${docfile} ${DOCSDIR}
.endfor
@cd ${WRKSRC} && ${COPYTREE_SHARE} "${DOCLIST}" ${DOCSDIR}
.endif
@${CAT} ${PKGMESSAGE}
+395
View File
@@ -0,0 +1,395 @@
--- ./flexbackup.orig 2008-07-19 09:56:20.000000000 +0200
+++ ./flexbackup 2008-07-19 09:58:09.000000000 +0200
@@ -269,6 +269,7 @@
untie(%::index);
}
+system ('rm', '-rf', $cfg::tmpdir);
exit(0);
######################################################################
@@ -441,7 +442,7 @@
# Get rid of trailing /
$dir = &nuke_trailing_slash($dir);
- # If level is icremental for the set, each dir might
+ # If level is incremental for the set, each dir might
# have a different numeric level
if (!defined($::set_incremental)) {
$level = $::level;
@@ -687,6 +688,8 @@
$filename .= ".zip";
} elsif ($cfg::compress eq "compress") {
$filename .= ".Z";
+ } elsif ($cfg::compress eq "lzma") {
+ $filename .= ".lzma";
}
} elsif ($cfg::type eq "afio") {
# tag these a little different, the archive file itself isn't a
@@ -701,6 +704,8 @@
$filename .= "-zip";
} elsif ($cfg::compress eq "compress") {
$filename .= "-Z";
+ } elsif ($cfg::compress eq "lzma") {
+ $filename .= "-lzma";
}
}
@@ -811,6 +816,11 @@
($remove, @cmds) = &backup_filelist($label, $localdir, $title, $level, $remote);
}
+ if(defined($remote)) {
+ # create our temporary directory as first remote command
+ unshift(@cmds, &maybe_remote_cmd("$::path{mkdir} -p $cfg::tmpdir", $remote));
+ }
+
# Nuke any tmp files used in the above routines
if ($remove ne '') {
push(@cmds, &maybe_remote_cmd("$::path{rm} -f $remove", $remote));
@@ -827,6 +837,11 @@
push(@cmds, &maybe_remote_cmd("$::path{rm} -f $pkglist", $remote));
}
}
+
+ if(defined($remote)) {
+ # remove temporary directory as our last remote command
+ push(@cmds, &maybe_remote_cmd("$::path{rm} -rf $cfg::tmpdir", $remote));
+ }
# Strip multiple spaces
foreach my $cmd (@cmds) {
@@ -1140,7 +1155,7 @@
$cmd .= "$::path{afio} -o ";
$cmd .= "$no_compress ";
$cmd .= "-z ";
- $cmd .= "-1 m ";
+ $cmd .= "-1 mC ";
$cmd .= "$::afio_z_flag ";
$cmd .= "$::afio_verb_flag ";
$cmd .= "$::afio_sparse_flag ";
@@ -1286,8 +1301,8 @@
$cmd .= "$::unz";
}
$cmd .= "(";
- $cmd .= "mkdir -p $::device ; ";
- $cmd .= "cd $::device ; ";
+ $cmd .= "mkdir -p \"$::device\" ; ";
+ $cmd .= "cd \"$::device\" ; ";
$cmd .= "$::path{cpio} -i ";
$cmd .= "-m ";
$cmd .= "-d ";
@@ -1336,9 +1351,8 @@
# Have to take leading './' off to make rsync's include/exclude work right
$cmd .= " | $::path{sed} -e \"s/\\.\\///g\" | ";
-
$cmd .= "$::path{rsync} ";
- $cmd .= "--include-from=- --exclude=* ";
+ $cmd .= "--files-from=- ";
$cmd .= "--archive ";
$cmd .= "$::rsync_verb_flag ";
$cmd .= "--delete --delete-excluded ";
@@ -1353,7 +1367,7 @@
$cmd .= "$remote:";
}
}
- $cmd .= "$dir/ $::device";
+ $cmd .= "\"$dir/\" \"$::device\"";
push(@cmds, $cmd);
@@ -1643,7 +1657,9 @@
my $tmpfile = "$cfg::tmpdir/ar.$PROCESS_ID";
my $remove = '';
- &log("| NOTE: ar archives will not descend directories");
+ &log("| NOTE: ar archives will not recurse into subdirectories,");
+ &log("| which makes them inappropriate for most backups.");
+ &log("| Be sure this is what you want.");
if (defined($remote) and ($level != 0)) {
my $time = &get_last_date($label, $level, 'numeric');
@@ -1667,11 +1683,13 @@
$cmd = "cd \"$dir\" && ";
$cmd .= &file_list_cmd( $dir, $stamp, 'newline', $level, $remote, '-maxdepth 1 ! -type d');
$cmd .= "> $filelist; ";
+ # Escape any spaces in filenames.
+ $cmd .= "$::path{sed} -i -e 's/ /\\\\ /g' $filelist; ";
$cmd .= "$::path{ar} rc";
$cmd .= "$::ar_verb_flag ";
$cmd .= "$tmpfile ";
- $cmd .= "`$::path{cat} $filelist`";
+ $cmd .= "\@$filelist ";
$cmd .= "; $::path{cat} $tmpfile $::z";
# Buffer both sides if remote
@@ -1785,12 +1803,9 @@
$cmd = "cd \"$dir\" && ";
$cmd .= &file_list_cmd( $dir, $stamp, 'newline', $level, $remote);
- $cmd .= "> $filelist; ";
-
- $cmd .= "$::path{lha} a";
+ $cmd .= " | $::path{lha} a";
$cmd .= "$::lha_verb_flag ";
$cmd .= "$tmpfile ";
- $cmd .= "`$::path{cat} $filelist`";
$cmd .= "; $::path{cat} $tmpfile $::z";
# Buffer both sides if remote
@@ -2700,7 +2715,7 @@
# First check if things are defined in the config file
# Checks exist, true/false, or one of options
&checkvar(\$cfg::type,'type','dump afio cpio tar star pax zip ar shar lha copy rsync filelist','tar');
- &checkvar(\$cfg::compress,'compress','gzip bzip2 lzop compress zip false hardware','gzip');
+ &checkvar(\$cfg::compress,'compress','gzip bzip2 lzop compress zip false hardware lzma','gzip');
&checkvar(\$cfg::compr_level,'compr_level','exist','4');
&checkvar(\$cfg::verbose,'verbose','bool','true');
&checkvar(\$cfg::sparse,'sparse','bool','true');
@@ -2750,8 +2765,10 @@
$::path{'find'} = &checkinpath('find');
$::path{'dd'} = &checkinpath('dd');
$::path{'printf'} = &checkinpath('printf');
+ $::path{'mkdir'} = &checkinpath('mkdir');
+ $::path{'sed'} = &checkinpath('sed');
- push(@::remoteprogs,($::path{'touch'},$::path{'rm'},$::path{'find'},$::path{'printf'}));
+ push(@::remoteprogs,($::path{'touch'},$::path{'rm'},$::path{'find'},$::path{'printf'},$::path{'mkdir'}));
# Check device (or dir)
$::ftape = 0;
@@ -3001,6 +3018,16 @@
$::z = " | $::path{zip} -$cfg::compr_level - -";
$::unz = "$::path{funzip} | ";
}
+ } elsif ($cfg::compress eq "lzma") {
+ $::path{'lzma'} = &checkinpath($cfg::compress);
+ push(@::remoteprogs, $::path{$cfg::compress});
+ if ($cfg::compr_level !~ m/^[123456789]$/) {
+ push(@::errors,"\$compr_level must be set to 1-9");
+ } else {
+ $::z = " | $::path{$cfg::compress} -$cfg::compr_level ";
+ }
+ $::unz = "$::path{$cfg::compress} -d | ";
+
} else {
$::z = "";
$::unz = "";
@@ -3059,12 +3086,11 @@
$::read_cmd = "$bufcmd $read_flags";
} elsif ($cfg::buffer eq "mbuffer") {
-
$::path{'mbuffer'} = &checkinpath('mbuffer');
push(@::remoteprogs, $::path{'mbuffer'});
my $megs = $cfg::buffer_megs . "M";
- my $bufcmd = "$::path{mbuffer} -q -m $megs -p $cfg::buffer_fill_pct $mbuffer_blk_flag ";
+ my $bufcmd = "$::path{mbuffer} -q -m $megs -P $cfg::buffer_fill_pct $mbuffer_blk_flag ";
$::buffer_cmd = " | $bufcmd";
$::write_cmd = "$bufcmd -f -o ";
@@ -3075,7 +3101,6 @@
}
}
} else {
-
# If buffering disabled, use dd or cat depending on if blocking turned off on not
if ($cfg::blksize eq '0') {
$::buffer_cmd = "";
@@ -3252,6 +3277,10 @@
$::afio_z_flag = "-P $::path{$cfg::compress} -Q -c -Z";
$::afio_unz_flag = "-P $::path{$cfg::compress} -Q -d -Q -c -Z";
+ } elsif ($cfg::compress eq "lzma") {
+ $::afio_z_flag = "-P $::path{$cfg::compress} -Q -$cfg::compr_level -Z";
+ $::afio_unz_flag = "-P $::path{$cfg::compress} -Q -d -Z";
+
}
$::unz = ""; # Reset & just use this for reading the archive file.
@@ -3415,7 +3444,7 @@
$::path{'lha'} = &checkinpath('lha');
push(@::remoteprogs, $::path{'lha'});
- if ($cfg::compress =~ /^(gzip|bzip2|lzop|compress|zip)$/) {
+ if ($cfg::compress =~ /^(gzip|bzip2|lzop|compress|zip|lzma)$/) {
warn("Using type \"lha\" with compress=$cfg::compress makes no sense");
warn("Setting compression to false");
$::unz = "";
@@ -3442,6 +3471,15 @@
push(@::errors,"\$tmpdir $cfg::tmpdir is not writable");
}
+ $cfg::hostname = `hostname`;
+ chomp($cfg::hostname);
+
+ # Use a subdirectory of the user-specified directory as our tmpdir
+ # Also note that we make it closer to globally unique as we sometimes
+ # use this variable for remote systems, so PID isn't enough
+ $cfg::tmpdir = $cfg::tmpdir .'/flexbackup.'.$$.'.'.$cfg::hostname;
+ mkdir ($cfg::tmpdir) || die "Can't create temporary directory, $!";
+
# Levels
if (defined($::opt{'level'}) and
(defined($::opt{'incremental'}) or
@@ -3781,7 +3819,7 @@
# Try and guess file types and commpression scheme
# might as well since we are reading from a file in this case
- if ($file =~ m/\.(dump|cpio|tar|star|pax|a|shar|filelist)\.(gz|bz2|lzo|Z|zip)$/) {
+ if ($file =~ m/\.(dump|cpio|tar|star|pax|a|shar|filelist)\.(gz|bz2|lzo|Z|zip|lzma)$/) {
$cfg::type = $1;
$cfg::compress = $2;
$cfg::type =~ s/^a$/ar/;
@@ -3789,16 +3827,18 @@
$cfg::compress =~ s/bz2/bzip2/;
$cfg::compress =~ s/lzo/lzop/;
$cfg::compress =~ s/Z/compress/;
+ $cfg::compress =~ s/lzma/lzma/;
&log("| Auto-set to type=$cfg::type compress=$cfg::compress");
&optioncheck(); # redo to set a few variables over
- } elsif ($file =~ m/\.afio-(gz|bz2|lzo|Z|zip)$/) {
+ } elsif ($file =~ m/\.afio-(gz|bz2|lzo|Z|zip|lzma)$/) {
$cfg::type = "afio";
$cfg::compress = $1;
$cfg::compress =~ s/gz/gzip/;
$cfg::compress =~ s/bz2/bzip2/;
$cfg::compress =~ s/lzo/lzop/;
$cfg::compress =~ s/Z/compress/;
+ $cfg::compress =~ s/lzma/lzma/;
&log("| Auto-set to type=$cfg::type compress=$cfg::compress");
&optioncheck(); # redo to set a few variables over
@@ -4843,23 +4883,31 @@
}
if (defined(%{$::prune{$prunekey}})) {
+ my $rex;
# FreeBSD needs -E (above) and no backslashes around the (|) chars
if ($::uname =~ /FreeBSD/) {
- $cmd .= '-regex "\./(';
- $cmd .= join('|', keys %{$::prune{$prunekey}});
- $cmd .= ')/.*" ';
- } else {
- $cmd .= '-regex "\./\(';
- $cmd .= join('\|', keys %{$::prune{$prunekey}});
- $cmd .= '\)/.*" ';
- }
- $cmd .= '-prune -o ';
+ $rex = '"\./(';
+ $rex .= join('|', keys %{$::prune{$prunekey}});
+ $rex .= ')"';
+ } else {
+ $rex = '"\./\(';
+ $rex .= join('\|', keys %{$::prune{$prunekey}});
+ $rex .= '\)"';
+ }
+ # Show what the darn thing is constructing for prune expressions.
+ (my $temp = $rex) =~ s/\\([()|])/$1/g;
+ &log("| \"find\" regex for pruning (shell escaping omitted for clarity) is:");
+ &log("| $temp");
+ $cmd .= '-regex ' . $rex . ' -prune -o ';
} else {
+ # Show what the darn thing is constructing for prune expressions.
+ &log("| No pruning defined for this tree.");
# Can't use find -depth with -prune (see single unix spec etc)
# (not toally required anyway, only if you are archiving dirs you
# don't have permissions on and are running as non-root)
$cmd .= "-depth ";
}
+ &line();
$cmd .= "$::mountpoint_flag ";
$cmd .= "! -type s ";
@@ -5229,6 +5277,7 @@
my $tmp_script = "$cfg::tmpdir/buftest.$host.$PROCESS_ID.sh";
my $retval = 0;
my $pipecmd;
+ my $explicit_success;
$buffer_cmd =~ s:^\s*\|\s*::;
$buffer_cmd =~ s:\s*\|\s*$::;
@@ -5236,14 +5285,14 @@
# Create a script which tests the buffer program
open(SCR,"> $tmp_script") || die;
print SCR "#!/bin/sh\n";
- print SCR "tmp_data=/tmp/bufftest\$\$.txt\n";
- print SCR "tmp_err=/tmp/bufftest\$\$.err\n";
+ print SCR "tmp_data=\`tempfile\`\n";
+ print SCR "tmp_err=\`tempfile\`\n";
print SCR "echo testme > \$tmp_data\n";
print SCR "$buffer_cmd > /dev/null 2> \$tmp_err < \$tmp_data\n";
print SCR "res=\$?\n";
print SCR "out=\`cat \$tmp_err\`\n";
print SCR "if [ \$res -eq 0 ]; then\n";
- print SCR " echo successful\n";
+ print SCR " echo \"successful\"\n";
print SCR "else\n";
print SCR " echo \"unsuccessful: exit code \$res: \$out\" \n";
print SCR "fi\n";
@@ -5254,14 +5303,22 @@
print $::msg "| Checking '$cfg::buffer' on this machine... ";
$pipecmd = "sh $tmp_script ";
} else {
+ $pipecmd =
+ "$::remoteshell $host '$::path{mkdir} -p $cfg::tmpdir'; " .
+ "cat $tmp_script | ($::remoteshell $host 'cat > $tmp_script; " .
+ "sh $tmp_script; rm -rf $cfg::tmpdir')";
print $::msg "| Checking '$cfg::buffer' on host $host... ";
- $pipecmd = "cat $tmp_script | ($::remoteshell $host 'cat > $tmp_script; sh $tmp_script; rm -f $tmp_script')";
}
if (!defined($::debug)) {
-
open(PIPE,"$pipecmd |") || die;
+
+ $explicit_success = 0;
while (<PIPE>) {
+ if (/^successful$/) {
+ $explicit_success = 1;
+ last;
+ }
if (/^unsuccessful: exit code (\d+): (.*)/) {
$retval = $1;
my $out = $2;
@@ -5290,11 +5347,15 @@
print $::msg "\n(debug) $pipecmd\n";
}
- if ($retval == 0) {
+ if ($explicit_success) {
print $::msg "Ok\n";
} else {
+ if ($retval == 0) {
+ push(@::errors, "Unanticipated problems encountered testing '$cfg::buffer' on host '$host'.");
+ } else {
print $::msg "Failed!\n";
}
+ }
unlink("$tmp_script");
return($retval);
@@ -5396,10 +5457,10 @@
my $shell = $1;
my $ver = $2;
if ($shell eq 'bash') {
- if ($ver =~ m/^2/) {
- $::shelltype{$host} = 'bash2';
- } else {
+ if ($ver =~ m/^1/) {
$::shelltype{$host} = 'bash1';
+ } else {
+ $::shelltype{$host} = 'bash2';
}
} else {
$::shelltype{$host} = $shell;
@@ -5686,3 +5747,5 @@
return($spinner[$index]);
}
+
+
@@ -0,0 +1,11 @@
--- ./flexbackup.1.orig 2008-07-19 09:56:14.000000000 +0200
+++ ./flexbackup.1 2008-07-19 09:57:40.000000000 +0200
@@ -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
+135 -4
View File
@@ -1,10 +1,141 @@
--- flexbackup.conf.orig Fri Sep 15 09:59:46 2006
+++ flexbackup.conf Fri Sep 15 10:00:32 2006
@@ -219,6 +219,8 @@
--- ./flexbackup.conf.orig 2008-07-19 09:56:25.000000000 +0200
+++ ./flexbackup.conf 2008-07-19 10:00:50.000000000 +0200
@@ -12,29 +12,92 @@
# Configure backup "sets".
# Not needed if you use "-dir <dir>" to backup one tree at a time.
-# Each set is a simple space-separated list of filesystems
-# Remote filesystems should denoted as 'host:dir'
-# You can use anything (other than 'all') as set names
+# Each set is a simple space-separated list of filesystems. Remote filesystems
+# should denoted as 'host:dir'. If the filesystem name (local or remote)
+# contains spaces, then it should be enclosed in its entirety in double quotes.
+# Multiple quoted filesystems included in a set should be space separated just
+# like unquoted filesystem. The Perl '.' string concatenation operator can be
+# used to split excessively long lines.
#
-# Example:
-# $set{'set1'} = "/home /usr";
-# $set{'set2'} = "/dir3 machine2:/dir4 machine3:/dir5";
+# You can use anything (other than 'all') as set names.
+#
+# Examples:
+# $set{'set1'} = '/home /usr';
+# $set{'set2'} = '/dir3 machine2:/dir4 machine3:/dir5';
+# $set{'set3'} =
+# '"/mnt/winmachine1/Documents and Settings" ' .
+# '"/mnt/winmachine1/Program Files"';
#
# "-set all" will back up all defined sets. If you are doing a full backup
# using tapes, each "set" will go onto a different tape and you will be
# prompted for tape change in between.
#
-$set{'backup'} = "/home";
+$set{'backup'} = '/home';
# 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!)
-$prune{'/'} = "tmp proc";
+# 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
+# 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.
+#
+# The regular expressions are processed by "find" but, before "find" is run,
+# FlexBackup changes into the base directory of the backup set in progress.
+# FlexBackup then runs "find" with a path of "." which means all output lines
+# start with "./". To be helpful, FlexBackup packages each space-separated
+# prune directory as follows. If you have a prune list like this
+#
+# $prune{'/somedir'} = 'one two three';
+#
+# then, the constructed -regex argument to "find" looks like this
+#
+# -regex "\./(one|two|three)"
+#
+# (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
+#
+# $set{'daily'} = '/home /root /var /usr';
+#
+# and you want to do some exclusions in "/home" and "/var" (but not the other
+# directories), you must set up a prune list for those two directories
+# separately. For example, to exclude bert's and ernie's home directories plus
+# /var/tmp, you would need the following:
+#
+# $prune{'/home'} = 'bert ernie';
+# $prune{'/var'} = 'tmp';
+#
+# In particular, combining these *does not* work. For example, this
+#
+# $prune{'/'} = 'home/bert home/ernie var/tmp';
+#
+# doesn't work, unless, of course, your backup set is backing up "/",
+# which our example is not.
+#
+# Like the $set configuration item, special handling is required for
+# directories with spaces in them. Double quotes should surround pruning
+# targets but not the key. Example:
+#
+# $prune{'/mnt/winmachine1/Documents and Settings'} =
+# '"user1/Local Settings/Temp" user2';
+#
+# 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
-$compress = 'gzip'; # one of false/gzip/bzip2/lzop/zip/compress/hardware
-$compr_level = '4'; # compression level (1-9) (for gzip/bzip2/lzop/zip)
+$compress = 'gzip'; # one of false/gzip/bzip2/lzop/zip/compress/hardware/lzma
+$compr_level = '4'; # compression level (1-9) (for gzip/bzip2/lzop/zip/lzma)
# Buffering program - to help streaming
$buffer = 'buffer'; # one of false/buffer/mbuffer
@@ -84,7 +147,8 @@
# True to try and preserve file access times during backup, if the selected
# archive program can do so. Note that if this is true, -cnewer checks (file
# permission/status changes only, not content) are turned off when deciding
-# which files to archive on the local system.
+# which files to archive on the local system. This is because preserving the
+# access time changes the permission/status change time in the filesystem.
$atime_preserve = 'false';
# Span across filesytems? ("dump" will ignore this option)
@@ -97,8 +161,13 @@
# leading directories (the filesystem specs above or the "-dir" flag).
# Matches paths, not filenames, so put .* on the front/back as needed.
# Comment these out to exclude nothing.
-$exclude_expr[0] = '.*/[Cc]ache/.*';
-$exclude_expr[1] = '.*~$';
+#
+# 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] = '.*~$';
# If true (default), and using a tape device, level zero "set" backups
# assume you want to erase and use a new tape for each set. If false, level
@@ -219,6 +288,8 @@
# $path{'afio'} = 'sudo -u nonrootuser afio';
#
+$path{'tar'} = %%TAR_CMD%%;
+$path{'tar'} = '%%TAR_CMD%%';
+
# ----------------------------------------------------------------------
# mt operation overrides. Set if flexbackup doesn't know the right mt
@@ -0,0 +1,77 @@
--- ./flexbackup.conf.5.orig 2008-07-19 09:56:34.000000000 +0200
+++ ./flexbackup.conf.5 2008-07-19 09:57:58.000000000 +0200
@@ -24,23 +24,51 @@
.TP
\fB$set{\fI'tag'\fR}\fR = \fI'/dir'\fR;
Configure backup \(dqsets\(dq. Not needed if \(dq-dir <dir>\(dq is used to
-backup one tree at a time. Each set is a simple space-separated list of
-filesystems/directories. Remote filesystems should be denoted as
-\(dqhost:directory\(dq. You can use anything (other than \fI'all'\fR) as set
-names. Using \(dq-set all\(dq will back up all defined sets. If you are doing
-a full backup using tapes, each \(dqset\(dq will go onto a different tape and
-you will be prompted for tape change in between. Examples:
+backup one tree at a time.
+Each set is a simple space-separated list of filesystems/directories.
+Remote filesystems should be denoted as \(dqhost:directory\(dq.
+You can use anything (other than \fI'all'\fR) as set names.
+Using \(dq-set all\(dq will back up all defined sets.
+If you are doing a full backup using tapes, each \(dqset\(dq will go onto a
+different tape and you will be prompted for tape change in between.
+Examples:
.RS
.PP
\fB$set{\fI'set1'\fI}\fR = \fI'/home /usr'\fR;
.br
\fB$set{\fI'set2'\fI}\fR = \fI'/dir3 machine2:/dir4 machine3:/dir5'\fR;
+.br
+.PP
+Directories (local or remote) with spaces in their names should be enclosed in
+their entirety in double quotes.
+Multiple quoted directories included in a set should be space separated just
+like unquoted directories.
+The Perl '.' string concatenation operator can be used to split excessively
+long sets.
+Example:
+.PP
+\fB$set{\fI'set3'\fI}\fR = \fI
+ '\(dq/mnt/winmachine1/Documents and Settings\(dq ' .
+ '\(dq/mnt/winmachine1/Program Files\(dq';\fR
.RE
.TP
\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!).
+.RS
+.PP
+Like the \fB$set\fR configuration item, special handling is required for
+directories with spaces in them. Double quotes should surround pruning targets
+but not the key. Example:
+.PP
+\fB$prune{\fI'/mnt/winmachine1/Documents and Settings'\fI}\fR =
+ \fI'\(dquser1/Local Settings/Temp\(dq user2'\fR;
+.br
+.PP
+There are lots of examples and additional explanation in the provided sample
+configuration file.
+.RE
.TP
\fB$compress\fR = \fI'false|gzip|bzip2|lzop|zip|compress|hardware'\fR;
.TQ
@@ -205,7 +233,7 @@
.RS
.TP
If GNU \fBtar\fR is called \fB\(dqgtar\(dq\fR on your system:
-\fB$path{'tar'} = 'gtar';
+\fB$path{'tar'} = 'gtar';\fR
.TP
Or it can be used to \fB\(dqsudo\(dq\fR certain commands:
\fB$path{\fI'find'\fR}\fR = \fI'sudo find'\fR;
@@ -302,3 +330,6 @@
Written by Edwin Huffstutler (edwinh@computer.org)
.SH "SEE ALSO"
\fBflexbackup\fR(1)
+.\" Local Variables:
+.\" mode: nroff
+.\" End:
+29
View File
@@ -0,0 +1,29 @@
--------------- Flexbackup Configuration Information ---------------
Flexbackup needs to have its configuration file placed in
%%PREFIX%%/etc. A template copy of this configuration file
has been installed into
%%PREFIX%%/etc/flexbackup.conf.sample
Please copy this file to
%%PREFIX%%/etc/flexbackup.conf
Edit this file appropriately on all machines where you will
run flexbackup.
NOTE: The flexbackup.conf file will not be removed or overwritten
by future package removals or upgrades once you have
customized it.
***************************************************************
** Changes have occurred in this file up to and including **
** version 1.2.0! **
***************************************************************
Also see %%PREFIX%%/share/doc/flexbackup/README
for more information on how to use flexbackup. Man pages have
also been written and included in this version of the port!
--------------------------------------------------------------------
+3
View File
@@ -11,4 +11,7 @@ Features:
o Keeps a table of contents so you know archives are on each tape
o Nice log files
You can get additional information about remote backup strategies using SSH
at http://www.sysfault.org/flexbackup.html
WWW: http://flexbackup.sourceforge.net/
-23
View File
@@ -1,23 +0,0 @@
--------------------- Flexbackup Configuration Information --------------------
Flexbackup needs to have its configuration file placed in /etc. A template
copy of this configuration file has been installed into
%%PREFIX%%/etc/flexbackup.conf.sample
Please copy this file as
%%CONFDIR%%/etc/flexbackup.conf
(on all machines where you will run flexbackup) and edit appropriately for your
site configuration.
****************************************************************************
** Changes have occurred in this file up to and including version 1.2.0! **
****************************************************************************
Also see %%PREFIX%%/share/doc/flexbackup/README
for more information on how to use flexbackup. Man pages have also been written
and included in this version of the port!
-------------------------------------------------------------------------------