Option to ignore read and file changed errors
authorJamie Cameron <jcameron@webmin.com>
Thu, 26 May 2011 21:32:28 +0000 (14:32 -0700)
committerJamie Cameron <jcameron@webmin.com>
Thu, 26 May 2011 21:32:28 +0000 (14:32 -0700)
https://www.virtualmin.com/node/18320

fsdump/help/ignoreread.html [new file with mode: 0644]
fsdump/lang/en
fsdump/linux-lib.pl

diff --git a/fsdump/help/ignoreread.html b/fsdump/help/ignoreread.html
new file mode 100644 (file)
index 0000000..5ec31e3
--- /dev/null
@@ -0,0 +1,9 @@
+<header>Ignore read errors on files?</header>
+
+When this option is set to <b>Yes</b>, any errors reading files that should
+be included in the backup will be ignored. It is useful for skipping the 
+usually useless error <i>file changed as we read it</i> , but may mask 
+permission or file corruption problems. <p>
+
+<footer>
+
index 3aedd0f..2cf9cd4 100644 (file)
@@ -91,6 +91,7 @@ dump_gzip2=Yes, with bzip
 dump_bcomp=Buffer compressed data into blocks?
 dump_xdev=Limit backup to one filesystem?
 dump_update2=Just add new files to archive?
+dump_ignoreread=Ignore read errors on files?
 dump_notape=Prompt for new tape if needed?
 dump_rmt=Path to <tt>rmt</tt> on remote system
 dump_links=Follow symbolic links?
index b0ea80c..57f3c26 100755 (executable)
@@ -99,6 +99,11 @@ if ($_[0]->{'fs'} eq 'tar') {
        print &ui_table_row(&hlink($text{'dump_update2'},"tarupdate"),
                            &ui_yesno_radio("update", int($_[0]->{'update'})),
                            1, $tds);
+
+       print &ui_table_row(&hlink($text{'dump_ignoreread'},"ignoreread"),
+                           &ui_yesno_radio("ignoreread",
+                                           int($_[0]->{'ignoreread'})),
+                           1, $tds);
        }
 elsif ($_[0]->{'fs'} eq 'xfs') {
        # Display xfs dump options
@@ -241,6 +246,7 @@ if ($_[0]->{'fs'} eq 'tar') {
                &error($text{'dump_eftpupdate'});
                }
        $_[0]->{'update'} = $in{'update'};
+       $_[0]->{'ignoreread'} = $in{'ignoreread'};
        if ($in{'gzip'} && $in{'update'}) {
                &error($text{'dump_egzip3'});
                }
@@ -357,6 +363,7 @@ if ($_[0]->{'fs'} eq 'tar') {
                if ($_[0]->{'rsh'} && $_[0]->{'host'});
        $cmd .= " --rmt-command=".quotemeta($_[0]->{'rmt'})
                if ($_[0]->{'rmt'});
+       $cmd .= " --ignore-failed-read" if ($_[0]->{'ignoreread'});
        if ($_[0]->{'exclude'}) {
                foreach my $e (&split_quoted_string($_[0]->{'exclude'})) {
                        $cmd .= " --exclude ".quotemeta($e);