View | Details | Raw Unified
Collapse All | Expand All

(-) flexbackup (-16 / +20 lines)
 Lines 1301-1308    Link Here 
	$cmd .= "$::unz";
	$cmd .= "$::unz";
    }
    }
    $cmd .= "(";
    $cmd .= "(";
    $cmd .= "mkdir -p $::device ; ";
    $cmd .= "mkdir -p \"$::device\" ; ";
    $cmd .= "cd $::device ; ";
    $cmd .= "cd \"$::device\" ; ";
    $cmd .= "$::path{cpio} -i ";
    $cmd .= "$::path{cpio} -i ";
    $cmd .= "-m ";
    $cmd .= "-m ";
    $cmd .= "-d ";
    $cmd .= "-d ";
 Lines 1351-1359    Link Here 
    # Have to take leading './' off to make rsync's include/exclude work right
    # Have to take leading './' off to make rsync's include/exclude work right
    $cmd .= " | $::path{sed} -e \"s/\\.\\///g\" | ";
    $cmd .= " | $::path{sed} -e \"s/\\.\\///g\" | ";
    $cmd .= "$::path{rsync} ";
    $cmd .= "$::path{rsync} ";
    $cmd .= "--include-from=- --exclude=* ";
    $cmd .= "--files-from=- ";
    $cmd .= "--archive ";
    $cmd .= "--archive ";
    $cmd .= "$::rsync_verb_flag ";
    $cmd .= "$::rsync_verb_flag ";
    $cmd .= "--delete --delete-excluded ";
    $cmd .= "--delete --delete-excluded ";
 Lines 1368-1374    Link Here 
	    $cmd .= "$remote:";
	    $cmd .= "$remote:";
	}
	}
    }
    }
    $cmd .= "$dir/ $::device";
    $cmd .= "\"$dir/\" \"$::device\"";
    push(@cmds, $cmd);
    push(@cmds, $cmd);
 Lines 1658-1664    Link Here 
    my $tmpfile = "$cfg::tmpdir/ar.$PROCESS_ID";
    my $tmpfile = "$cfg::tmpdir/ar.$PROCESS_ID";
    my $remove = '';
    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)) {
    if (defined($remote) and ($level != 0)) {
	my $time = &get_last_date($label, $level, 'numeric');
	my $time = &get_last_date($label, $level, 'numeric');
 Lines 1682-1692    Link Here 
    $cmd = "cd \"$dir\" && ";
    $cmd = "cd \"$dir\" && ";
    $cmd .= &file_list_cmd( $dir, $stamp, 'newline', $level, $remote, '-maxdepth 1 ! -type d');
    $cmd .= &file_list_cmd( $dir, $stamp, 'newline', $level, $remote, '-maxdepth 1 ! -type d');
    $cmd .= "> $filelist; ";
    $cmd .= "> $filelist; ";
    # Escape any spaces in filenames. 
    $cmd .= "$::path{sed} -i -e 's/ /\\\\ /g' $filelist; ";
    $cmd .= "$::path{ar} rc";
    $cmd .= "$::path{ar} rc";
    $cmd .= "$::ar_verb_flag ";
    $cmd .= "$::ar_verb_flag ";
    $cmd .= "$tmpfile ";
    $cmd .= "$tmpfile ";
    $cmd .= "`$::path{cat} $filelist`";
    $cmd .= "\@$filelist ";
    $cmd .= "; $::path{cat} $tmpfile $::z";
    $cmd .= "; $::path{cat} $tmpfile $::z";
    # Buffer both sides if remote
    # Buffer both sides if remote
 Lines 1800-1811    Link Here 
    $cmd = "cd \"$dir\" && ";
    $cmd = "cd \"$dir\" && ";
    $cmd .= &file_list_cmd( $dir, $stamp, 'newline', $level, $remote);
    $cmd .= &file_list_cmd( $dir, $stamp, 'newline', $level, $remote);
    $cmd .= "> $filelist; ";
    $cmd .= " | $::path{lha} a";
    $cmd .= "$::path{lha} a";
    $cmd .= "$::lha_verb_flag ";
    $cmd .= "$::lha_verb_flag ";
    $cmd .= "$tmpfile ";
    $cmd .= "$tmpfile ";
    $cmd .= "`$::path{cat} $filelist`";
    $cmd .= "; $::path{cat} $tmpfile $::z";
    $cmd .= "; $::path{cat} $tmpfile $::z";
    # Buffer both sides if remote
    # Buffer both sides if remote
 Lines 2766-2771    Link Here 
    $::path{'dd'} = &checkinpath('dd');
    $::path{'dd'} = &checkinpath('dd');
    $::path{'printf'} = &checkinpath('printf');
    $::path{'printf'} = &checkinpath('printf');
    $::path{'mkdir'} = &checkinpath('mkdir');
    $::path{'mkdir'} = &checkinpath('mkdir');
	$::path{'sed'} = &checkinpath('sed');
    push(@::remoteprogs,($::path{'touch'},$::path{'rm'},$::path{'find'},$::path{'printf'},$::path{'mkdir'}));
    push(@::remoteprogs,($::path{'touch'},$::path{'rm'},$::path{'find'},$::path{'printf'},$::path{'mkdir'}));
 Lines 4894-4902    Link Here 
			$rex .= '\)"';
			$rex .= '\)"';
		}
		}
		# Show what the darn thing is constructing for prune expressions.
		# Show what the darn thing is constructing for prune expressions.
		&log("| \"find\" regex for pruning is:");
        (my $temp = $rex) =~ s/\\([()|])/$1/g;
		&log("|     $rex");
		&log("| \"find\" regex for pruning (shell escaping omitted for clarity) is:");
		&line();
		&log("|     $temp");
		$cmd .= '-regex ' . $rex . ' -prune -o ';
		$cmd .= '-regex ' . $rex . ' -prune -o ';
    } else {
    } else {
		# Show what the darn thing is constructing for prune expressions.
		# Show what the darn thing is constructing for prune expressions.
 Lines 4906-4911    Link Here 
		# don't have permissions on and are running as non-root)
		# don't have permissions on and are running as non-root)
		$cmd .= "-depth ";
		$cmd .= "-depth ";
    }
    }
    &line();
    $cmd .= "$::mountpoint_flag ";
    $cmd .= "$::mountpoint_flag ";
    $cmd .= "! -type s ";
    $cmd .= "! -type s ";
 Lines 5301-5312    Link Here 
	print $::msg "| Checking '$cfg::buffer' on this machine... ";
	print $::msg "| Checking '$cfg::buffer' on this machine... ";
	$pipecmd = "sh $tmp_script ";
	$pipecmd = "sh $tmp_script ";
    } else {
    } 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... ";
	print $::msg "| Checking '$cfg::buffer' on host $host... ";
	$pipecmd =  "$::remoteshell $host '$::path{mkdir} -p $cfg::tmpdir'; cat $tmp_script | ($::remoteshell $host 'cat > $tmp_script; sh $tmp_script; rm -rf $cfg::tmpdir')";
    }
    }
    if (!defined($::debug)) {
    if (!defined($::debug)) {
	open(PIPE,"$pipecmd |") || die;
	open(PIPE,"$pipecmd |") || die;
	$explicit_success = 0;
	$explicit_success = 0;
(-) flexbackup.conf (-15 / +30 lines)
 Lines 12-30    Link Here 
# Configure backup "sets".
# Configure backup "sets".
# Not needed if you use "-dir <dir>" to backup one tree at a time.
# Not needed if you use "-dir <dir>" to backup one tree at a time.
# Each set is a simple space-separated list of filesystems
# Each set is a simple space-separated list of filesystems.  Remote filesystems
# Remote filesystems should denoted as 'host:dir'
# should denoted as 'host:dir'.  If the filesystem name (local or remote)
# You can use anything (other than 'all') as set names
# 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
# Example:
# like unquoted filesystem.  The Perl '.' string concatenation operator can be
#  $set{'set1'} = "/home /usr";
# used to split excessively long lines.
#  $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
# "-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
# using tapes, each "set" will go onto a different tape and you will be
# prompted for tape change in between.
# prompted for tape change in between.
#
#
$set{'backup'} = "/home";
$set{'backup'} = '/home';
# 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.
 Lines 42-48    Link Here 
# start with "./".  To be helpful, FlexBackup packages each space-separated
# start with "./".  To be helpful, FlexBackup packages each space-separated
# prune directory as follows.  If you have a prune list like this
# prune directory as follows.  If you have a prune list like this
#
#
#     $prune{'/somedir'} = "one two three";
#     $prune{'/somedir'} = 'one two three';
#
#
# then, the constructed -regex argument to "find" looks like this
# then, the constructed -regex argument to "find" looks like this
#
#
 Lines 54-84    Link Here 
# 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
#
#
#     $set{'daily'} = "/home /root /var /usr";
#     $set{'daily'} = '/home /root /var /usr';
#
#
# and you want to do some exclusions in "/home" and "/var" (but not the other
# 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 
# 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
# separately.  For example, to exclude bert's and ernie's home directories plus
# /var/tmp, you would need the following:
# /var/tmp, you would need the following:
#
#
#     $prune{'/home'} = "bert ernie";
#     $prune{'/home'} = 'bert ernie';
#     $prune{'/var'}  = "tmp";
#     $prune{'/var'}  = 'tmp';
#
#
# In particular, combining these *does not* work.  For example, this
# In particular, combining these *does not* work.  For example, this
#
#
#     $prune{'/'} = "home/bert home/ernie var/tmp";
#     $prune{'/'} = 'home/bert home/ernie var/tmp';
#
#
# doesn't 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.
#
#
# 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 
# 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
# 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
# contents, you can do it.  Picking on ernie from our previous example, preserve
# only his home directory:
# only his home directory:
#
#
#     $prune{'/home'} = "ernie/.*";
#     $prune{'/home'} = 'ernie/.*';
#
#
$prune{'/'} = "tmp proc";
$prune{'/'} = 'tmp proc';
# Compression
# Compression
$compress = 'gzip'; # one of false/gzip/bzip2/lzop/zip/compress/hardware/lzma
$compress = 'gzip'; # one of false/gzip/bzip2/lzop/zip/compress/hardware/lzma
(-) flexbackup.conf.5 (-10 / +39 lines)
 Lines 24-48    Link Here 
.TP
.TP
\fB$set{\fI'tag'\fR}\fR = \fI'/dir'\fR;
\fB$set{\fI'tag'\fR}\fR = \fI'/dir'\fR;
Configure backup \(dqsets\(dq. Not needed if \(dq-dir <dir>\(dq is used to
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
backup one tree at a time.
filesystems/directories. Remote filesystems should be denoted as
Each set is a simple space-separated list of filesystems/directories.
\(dqhost:directory\(dq.  You can use anything (other than \fI'all'\fR) as set
Remote filesystems should be denoted as \(dqhost:directory\(dq.
names. Using \(dq-set all\(dq will back up all defined sets. If you are doing
You can use anything (other than \fI'all'\fR) as set names.
a full backup using tapes, each \(dqset\(dq will go onto a different tape and
Using \(dq-set all\(dq will back up all defined sets.
you will be prompted for tape change in between. Examples:
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
.RS
.PP
.PP
\fB$set{\fI'set1'\fI}\fR = \fI'/home /usr'\fR;
\fB$set{\fI'set1'\fI}\fR = \fI'/home /usr'\fR;
.br
.br
\fB$set{\fI'set2'\fI}\fR = \fI'/dir3 machine2:/dir4 machine3:/dir5'\fR;
\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
.RE
.TP
.TP
\fB$prune{\fI'/'\fR}\fR = \fI'tmp proc'\fR;
\fB$prune{\fI'/'\fR}\fR = \fI'tmp proc'\fR;
Configure subtree pruning. A space-separated list of directories to prune from
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
each backup. Key is a filesystem/directory or \(dqhost:directory\(dq spec as
outlined above. Regular expressions allowed (not shell-type wildcards!). There
outlined above. Regular expressions allowed (not shell-type wildcards!).
is additional explanation (and a lot of examples) in the provided configuration
.RS
file.
.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
.TP
\fB$compress\fR = \fI'false|gzip|bzip2|lzop|zip|compress|hardware'\fR;
\fB$compress\fR = \fI'false|gzip|bzip2|lzop|zip|compress|hardware'\fR;
.TQ
.TQ
 Lines 207-213    Link Here 
.RS
.RS
.TP
.TP
If GNU \fBtar\fR is called \fB\(dqgtar\(dq\fR on your system:
If GNU \fBtar\fR is called \fB\(dqgtar\(dq\fR on your system:
\fB$path{'tar'} = 'gtar';
\fB$path{'tar'} = 'gtar';\fR
.TP
.TP
Or it can be used to \fB\(dqsudo\(dq\fR certain commands:
Or it can be used to \fB\(dqsudo\(dq\fR certain commands:
\fB$path{\fI'find'\fR}\fR = \fI'sudo find'\fR;
\fB$path{\fI'find'\fR}\fR = \fI'sudo find'\fR;
 Lines 304-306    Link Here 
Written by Edwin Huffstutler (edwinh@computer.org)
Written by Edwin Huffstutler (edwinh@computer.org)
.SH "SEE ALSO"
.SH "SEE ALSO"
\fBflexbackup\fR(1)
\fBflexbackup\fR(1)
.\" Local Variables:
.\" mode: nroff
.\" End: