use DateTime::Duration to correctly convert partial dates in to fields
[BackupPC.git] / bin / BackupPC_tarCreate
index bb9f696..9af2931 100755 (executable)
@@ -76,7 +76,7 @@ die("BackupPC::Lib->new failed\n") if ( !(my $bpc = BackupPC::Lib->new) );
 
 my %opts;
 
-if ( !getopts("Llte:h:n:p:r:s:b:w:", \%opts) || @ARGV < 1 ) {
+if ( !getopts("Llte:h:n:p:r:s:b:w:i", \%opts) || @ARGV < 1 ) {
     print STDERR <<EOF;
 usage: $0 [options] files/directories...
   Required options:
@@ -96,6 +96,7 @@ usage: $0 [options] files/directories...
                      \$Conf{ClientCharset} when backup was done)
      -l              just print a file listing; don't generate an archive
      -L              just print a detailed file listing; don't generate an archive
+     -i              create incremental tar dump with just new files
 EOF
     exit(1);
 }
@@ -140,8 +141,17 @@ if ( $opts{s} =~ m{(^|/)\.\.(/|$)} ) {
     exit(1);
 }
 
+# XXX ASA Search extension
+my $view_opts;
+
+my %Conf = $bpc->Conf;
+if ( $Conf{TarCreateIncremental} || $opts{i} ) {
+       warn "# incremental dump";
+       $view_opts = { only_increment => 1 };
+}
+
 our $ShareName = $opts{s};
-our $view = BackupPC::View->new($bpc, $Host, \@Backups);
+our $view = BackupPC::View->new($bpc, $Host, \@Backups, $view_opts);
 
 #
 # This constant and the line of code below that uses it are borrowed