X-Git-Url: http://git.rot13.org/?p=BackupPC.git;a=blobdiff_plain;f=bin%2FBackupPC_ASA_SearchUpdate;h=ba499f97323020baee06b6da7e74cefbe51d8ac5;hp=d8600370d55b2605bf4438fb5ebce2af1ebb0e1b;hb=c615e1bfc6f2b0604a2658996f5dd6b6cfa9469c;hpb=5da6f2d3b119993d9def86b5481a86ce6fd84059 diff --git a/bin/BackupPC_ASA_SearchUpdate b/bin/BackupPC_ASA_SearchUpdate index d860037..ba499f9 100755 --- a/bin/BackupPC_ASA_SearchUpdate +++ b/bin/BackupPC_ASA_SearchUpdate @@ -312,14 +312,15 @@ my $host_nr = 0; foreach my $host_key (@hosts) { my $hostname = $hosts->{$host_key}->{'host'} || die "can't find host for $host_key"; + $hostname = lc $hostname; - next if $opt->host && ! grep { m/^$hostname$/ } @{ $opt->host }; + next if $opt->host && ! grep { m/^$hostname$/i } @{ $opt->host }; $sth->{hosts_by_name}->execute($hostname); unless (($hostID) = $sth->{hosts_by_name}->fetchrow_array()) { $sth->{insert_hosts}->execute( - $hosts->{$host_key}->{'host'}, + $hostname, $hosts->{$host_key}->{'ip'} ); @@ -744,14 +745,16 @@ JOIN shares ON shareid = shares.id CREATE VIEW backups_burned AS -SELECT - backup_id, - count(backup_id) = count(backup_part_id) as burned -FROM archive -JOIN archive_parts ON archive.id = archive_id -JOIN backup_parts ON backup_part_id = backup_id -GROUP BY backup_id -; +SELECT backup_parts.backup_id, +count(backup_parts.backup_id) as backup_parts, +count(archive_burned.archive_id) AS burned_parts, +count(backup_parts.backup_id) = count(archive_burned.archive_id) as burned + FROM backup_parts + left outer JOIN archive_parts ON backup_part_id = backup_parts.id + left join archive on archive.id = archive_id + left outer join archive_burned on archive_burned.archive_id = archive.id + GROUP BY backup_parts.backup_id ; + -- triggers for backup_parts consistency create or replace function backup_parts_check() returns trigger as '