1 |
#!/usr/local/bin/perl -w |
#!/usr/local/bin/perl |
2 |
$| = 1; |
$| = 1; |
3 |
|
|
4 |
use strict; |
use strict; |
127 |
#################################INSERT VALUES############################# |
#################################INSERT VALUES############################# |
128 |
|
|
129 |
# get hosts |
# get hosts |
130 |
$hosts = $bpc->HostInfoRead("localhost"); |
$hosts = $bpc->HostInfoRead(); |
131 |
my $host_key; |
print Dumper($hosts); |
132 |
my $hostID; |
my $hostID; |
133 |
my $shareID; |
my $shareID; |
134 |
foreach $host_key (keys %{$hosts}) |
foreach my $host_key (keys %{$hosts}) |
135 |
{ |
{ |
136 |
my $hostname = $hosts->{$host_key}->{'host'}; |
my $hostname = $hosts->{$host_key}->{'host'} || die "can't find host for $host_key"; |
137 |
my $backups; |
my $backups; |
138 |
my $sql; |
my $sql; |
139 |
|
|
141 |
my $st = $dbh->prepare($sql); |
my $st = $dbh->prepare($sql); |
142 |
$st->bind_param(1,$hosts->{$host_key}->{'host'}); |
$st->bind_param(1,$hosts->{$host_key}->{'host'}); |
143 |
$st->execute(); |
$st->execute(); |
144 |
my $tmp = $st->fetchrow_hashref(); |
if (my $tmp = $st->fetchrow_hashref()) |
|
if ($tmp->{'ID'} ne "") |
|
145 |
{ |
{ |
146 |
$hostID = $tmp->{'ID'}; |
$hostID = $tmp->{'ID'}; |
147 |
} |
} |