Option to just update tar archives
authorJamie Cameron <jcameron@webmin.com>
Sat, 2 Feb 2008 22:21:27 +0000 (22:21 +0000)
committerJamie Cameron <jcameron@webmin.com>
Sat, 2 Feb 2008 22:21:27 +0000 (22:21 +0000)
fsdump/CHANGELOG
fsdump/help/tarupdate.html [new file with mode: 0644]
fsdump/lang/en
fsdump/linux-lib.pl

index afc67ca..517ded3 100644 (file)
@@ -27,3 +27,5 @@ Added an option for setting the path to the remote rmt command for tar format ba
 On Linux and BSD systems, backups and restores in TAR or EXT formats can be done via FTP as well as SSH, RSH and to local files.
 ---- Changes since 1.320 ----
 Added a warning if % is used in filenames but strftime substition is not enabled.
+---- Changes since 1.390 ----
+When making tar format backups on Linux, an option to just append new files to the archive instead of over-writing it is available.
diff --git a/fsdump/help/tarupdate.html b/fsdump/help/tarupdate.html
new file mode 100644 (file)
index 0000000..89c1822
--- /dev/null
@@ -0,0 +1,8 @@
+<header>Just add new files to archive?</header>
+
+When this is set to <b>No</b> (as it is by default), the backup destination
+will be replaced with an archive of all files currently in the source directories. But if you select <b>Yes</b>, only files that have been changed since the
+archive was create will be appended to it. This is useful when making incremental backups. However, it cannot be used with compressed or remote archives. <p>
+
+<footer>
+
index 5d45ffe..b0ce390 100644 (file)
@@ -87,11 +87,13 @@ dump_gzip1=Yes, with gzip
 dump_gzip2=Yes, with bzip
 dump_bcomp=Buffer compressed data into blocks?
 dump_xdev=Limit backup to one filesystem?
+dump_update=Just add new files to archive?
 dump_notape=Prompt for new tape if needed?
 dump_rmt=Path to <tt>rmt</tt> on remote system
 dump_links=Follow symbolic links?
 dump_egzip=The gzip compression option is incompatible with the tape size option
 dump_egzip2=The gzip compression option is incompatible with the multi-file backup option
+dump_egzip3=The gzip compression option is incompatible with the option to just add new files to the archive
 dump_emulti=Multi-file backups cannot be done to a tape device
 dump_emulti2=Multi-file backups cannot be done to a remote server
 dump_ermt=Missing or invalid path to <tt>rmt</tt> program
index b0a77f7..a096165 100644 (file)
@@ -91,6 +91,10 @@ if ($_[0]->{'fs'} eq 'tar') {
                            &ui_radio("notape", int($_[0]->{'notape'}),
                                  [ [ 0, $text{'yes'} ], [ 1, $text{'no'} ] ]),
                            1, $tds);
+
+       print &ui_table_row(&hlink($text{'dump_update'},"tarupdate"),
+                           &ui_yesno_radio("update", int($_[0]->{'update'})),
+                           1, $tds);
        }
 elsif ($_[0]->{'fs'} eq 'xfs') {
        # Display xfs dump options
@@ -225,6 +229,10 @@ if ($_[0]->{'fs'} eq 'tar') {
        $_[0]->{'multi'} = $in{'multi'};
        $_[0]->{'links'} = $in{'links'};
        $_[0]->{'xdev'} = $in{'xdev'};
+       $_[0]->{'update'} = $in{'update'};
+       if ($in{'gzip'} && $in{'update'}) {
+               &error($text{'dump_egzip3'});
+               }
        if ($in{'multi'}) {
                !-c $in{'file'} && !-b $in{'file'} ||
                        &error($text{'dump_emulti'});
@@ -321,7 +329,7 @@ local $tapecmd = $_[0]->{'multi'} && $_[0]->{'fs'} eq 'tar' ? $multi_cmd :
 local @dirs = split(/\s+/, $_[0]->{'dir'});
 if ($_[0]->{'fs'} eq 'tar') {
        # tar format backup
-       $cmd = "tar -c $flag";
+       $cmd = "tar ".($_[0]->{'update'} ? "-u" : "-c")." ".$flag;
        $cmd .= " -V '$_[0]->{'label'}'" if ($_[0]->{'label'});
        $cmd .= " -L $_[0]->{'blocks'}" if ($_[0]->{'blocks'});
        $cmd .= " -z" if ($_[0]->{'gzip'} == 1);