use File::Slurp;
use File::Pid;
+=head1 NAME
+
+BackupPC_incPartsUpdate
+
+=head1 DESCRIPTION
+
+Create C<.tar.gz> increments on disk calling C<BackupPC_tarIncCreate>.
+
+Following options are supported (but all are optional):
+
+=over 4
+
+=item -h hostname
+
+Update parts for just single C<hostname>
+
+=item -c
+
+Force check for tar archives which exist on disk
+
+=item -d
+
+Turn debugging output
+
+=back
+
+=cut
+
+my %opt;
+getopts("cdh:", \%opt );
+
+my $debug = $opt{d};
+my $check = $opt{c} && print STDERR "NOTICE: tar archive check forced\n";
+
my $pid_path = abs_path($0);
$pid_path =~ s/\W+/_/g;
$bin->{$c} = which($c) || die "$0 needs $c, install it\n";
}
-my %opt;
-getopts("cd", \%opt );
-
-my $debug = $opt{d};
-my $check = $opt{c} && print STDERR "NOTICE: tar archive check forced\n";
-
$|=1;
my $start_t = time();
my $num_backups = $sth->rows;
my $curr_backup = 1;
+if ($opt{h}) {
+ warn "making increments just for host $opt{h}\n";
+}
+
while (my $row = $sth->fetchrow_hashref) {
+ if ($opt{h} && $row->{host} ne $opt{h}) {
+ warn "skipped $row->{host}\n" if ($debug);
+ next;
+ }
+
$curr_backup++;
my $tar_file = BackupPC::SearchLib::getGzipName($row->{'host'}, $row->{'share'}, $row->{'num'});