TAR exclude options

This commit is contained in:
Jamie Cameron
2008-02-18 21:03:28 +00:00
parent 2d433c04bc
commit d8915bac60
4 changed files with 18 additions and 0 deletions

View File

@@ -31,3 +31,4 @@ Added a warning if % is used in filenames but strftime substition is not enabled
When making tar format backups on Linux, an option to just append new files to the archive instead of over-writing it is available.
---- Changes since 1.400 ----
Fixed remote tar backups via FTP on OSX.
Files and directories to exclude can be specified for TAR format backups on Linux.

6
fsdump/help/exclude.html Normal file
View File

@@ -0,0 +1,6 @@
<header>Files and directories to skip</header>
This field can be used to enter a list of space-separated filenames to exclude from the backup. You can also enter full paths like <tt>/etc/passwd</tt>, or shell patterns like <tt>*.tmp</tt>. <p>
<footer>

View File

@@ -37,6 +37,7 @@ dump_level_0=(Full backup)
dump_label=Backup label
dump_multi=Split across multiple files?
dump_update=Update <tt>/etc/dumpdates</tt> file?
dump_exclude=Files and directories to skip
dump_edir=Missing or invalid directory to backup
dump_efile=Missing file or device to backup to
dump_ehost=Missing or invalid host to backup to

View File

@@ -69,6 +69,10 @@ if ($_[0]->{'fs'} eq 'tar') {
$text{'dump_auto'})." kB",
3, $tds);
print &ui_table_row(&hlink($text{'dump_exclude'}, "exclude"),
&ui_textbox("exclude", $_[0]->{'exclude'}, 50),
3, $tds);
print &ui_table_row(&hlink($text{'dump_gzip'},"gzip"),
&ui_select("gzip", int($_[0]->{'gzip'}),
[ [ 0, $text{'no'} ],
@@ -225,6 +229,7 @@ if ($_[0]->{'fs'} eq 'tar') {
$_[0]->{'blocks'} = $in{'blocks'};
$in{'gzip'} && &error($text{'dump_egzip'});
}
$_[0]->{'exclude'} = $in{'exclude'};
$_[0]->{'gzip'} = $in{'gzip'};
$_[0]->{'multi'} = $in{'multi'};
$_[0]->{'links'} = $in{'links'};
@@ -340,6 +345,11 @@ if ($_[0]->{'fs'} eq 'tar') {
$cmd .= " -F \"$tapecmd $_[0]->{'id'}\"" if (!$_[0]->{'gzip'} && $tapecmd);
$cmd .= " --rsh-command=".quotemeta($_[0]->{'rsh'}) if ($_[0]->{'rsh'});
$cmd .= " --rmt-command=".quotemeta($_[0]->{'rmt'}) if ($_[0]->{'rmt'});
if ($_[0]->{'exclude'}) {
foreach my $e (&split_quoted_string($_[0]->{'exclude'})) {
$cmd .= " --exclude ".quotemeta($e);
}
}
$cmd .= " $_[0]->{'extra'}" if ($_[0]->{'extra'});
$cmd .= " ".join(" ", map { "'$_'" } @dirs);
}