projects
/
BackupPC.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
increase to timestamp until end of day
[BackupPC.git]
/
lib
/
BackupPC
/
Search.pm
diff --git
a/lib/BackupPC/Search.pm
b/lib/BackupPC/Search.pm
index
a6f01ff
..
3783c55
100644
(file)
--- a/
lib/BackupPC/Search.pm
+++ b/
lib/BackupPC/Search.pm
@@
-45,7
+45,7
@@
sub get_dbh {
return $dbh;
}
return $dbh;
}
-sub get
Units()
{
+sub get
Shares
{
my @ret;
my $dbh = get_dbh();
my @ret;
my $dbh = get_dbh();
@@
-61,6
+61,9
@@
sub getUnits() {
push @ret, { 'id' => '', 'share' => '-'}; # dummy any
while ( my $row = $sth->fetchrow_hashref() ) {
push @ret, { 'id' => '', 'share' => '-'}; # dummy any
while ( my $row = $sth->fetchrow_hashref() ) {
+ if ( my $hide = $Conf{SearchHideShare} ) {
+ next if $row->{share} =~ m/$hide/;
+ }
push @ret, $row;
}
return @ret;
push @ret, $row;
}
return @ret;
@@
-101,6
+104,12
@@
sub dates_from_form($) {
$dt -= DateTime::Duration->new( days => 1 );
}
$dt -= DateTime::Duration->new( days => 1 );
}
+ if ( $suffix eq 'to' ) {
+ # to end of day
+ $dt += DateTime::Duration->new( days => 1 );
+ $dt -= DateTime::Duration->new( seconds => 1 );
+ }
+
print STDERR "mk_epoch_date($name,$suffix) [$yyyy-$mm-$dd] = " . $dt->ymd . " " . $dt->hms . "\n";
return $dt->epoch || 'NULL';
}
print STDERR "mk_epoch_date($name,$suffix) [$yyyy-$mm-$dd] = " . $dt->ymd . " " . $dt->hms . "\n";
return $dt->epoch || 'NULL';
}
@@
-371,13
+380,15
@@
sub host_backup_nums {
# and inc_size < 0 and size > 0 and not inc_deleted
my $all_backup_numbers;
# and inc_size < 0 and size > 0 and not inc_deleted
my $all_backup_numbers;
+ # pre-seed with on disk backups
+ $all_backup_numbers->{ $_->{num} }++ foreach $bpc->BackupInfoRead($host);
while( my $row = $sth->fetchrow_hashref ) {
warn "# row ",dump $row;
$all_backup_numbers->{ $row->{num} } =
$row->{inc_deleted} ? 0 :
$row->{size} == 0 ? 0 :
while( my $row = $sth->fetchrow_hashref ) {
warn "# row ",dump $row;
$all_backup_numbers->{ $row->{num} } =
$row->{inc_deleted} ? 0 :
$row->{size} == 0 ? 0 :
- $row->{inc_size}
>
0 ? 0 :
+ $row->{inc_size}
!=
0 ? 0 :
$row->{size} > 0 ? 1 :
0;
}
$row->{size} > 0 ? 1 :
0;
}