337 |
backups.type AS type, |
backups.type AS type, |
338 |
backups.date AS date, |
backups.date AS date, |
339 |
backups.size AS size, |
backups.size AS size, |
340 |
backups.id AS id |
backups.id AS id, |
341 |
|
backups.inc_size AS inc_size |
342 |
FROM backups |
FROM backups |
343 |
INNER JOIN shares ON backups.shareID=shares.ID |
INNER JOIN shares ON backups.shareID=shares.ID |
344 |
INNER JOIN hosts ON backups.hostID = hosts.ID |
INNER JOIN hosts ON backups.hostID = hosts.ID |
345 |
LEFT OUTER JOIN archive_backup ON archive_backup.backup_id = backups.id |
LEFT OUTER JOIN archive_backup ON archive_backup.backup_id = backups.id |
346 |
WHERE backups.size > 0 AND archive_backup.backup_id IS NULL |
WHERE backups.size > 0 AND backups.inc_size > 0 AND archive_backup.backup_id IS NULL |
347 |
GROUP BY |
GROUP BY |
348 |
backups.hostID, |
backups.hostID, |
349 |
hosts.name, |
hosts.name, |
353 |
backups.id, |
backups.id, |
354 |
backups.type, |
backups.type, |
355 |
backups.date, |
backups.date, |
356 |
backups.size |
backups.size, |
357 |
|
backups.inc_size |
358 |
ORDER BY backups.date |
ORDER BY backups.date |
359 |
}; |
}; |
360 |
my $sth = $dbh->prepare( $sql ); |
my $sth = $dbh->prepare( $sql ); |
364 |
while ( my $row = $sth->fetchrow_hashref() ) { |
while ( my $row = $sth->fetchrow_hashref() ) { |
365 |
$row->{'age'} = sprintf("%0.1f", ( (time() - $row->{'date'}) / 86400 ) ); |
$row->{'age'} = sprintf("%0.1f", ( (time() - $row->{'date'}) / 86400 ) ); |
366 |
$row->{'size'} = sprintf("%0.2f", $row->{'size'} / 1024 / 1024); |
$row->{'size'} = sprintf("%0.2f", $row->{'size'} / 1024 / 1024); |
367 |
my (undef,undef,undef,undef,undef,undef,undef,$fs_size,undef,undef,undef,undef,undef) = |
|
368 |
stat( $Conf{InstallDir}.'/'.$Conf{GzipTempDir}.'/'. |
# do some cluster calculation (approximate) and convert to kB |
369 |
getGzipName($row->{'host'}, $row->{share}, $row->{'backupnum'})); |
$row->{'inc_size'} = int($row->{'inc_size'} / ( 2 * 1024) * 2); |
|
$row->{'fs_size'} = $fs_size; |
|
370 |
push @ret, $row; |
push @ret, $row; |
371 |
} |
} |
372 |
|
|
689 |
<td align="center">date</td> |
<td align="center">date</td> |
690 |
<td align="center">age/days</td> |
<td align="center">age/days</td> |
691 |
<td align="center">size/MB</td> |
<td align="center">size/MB</td> |
692 |
<td align="center">gzip size</td> |
<td align="center">gzip size/kB</td> |
693 |
</tr> |
</tr> |
694 |
|
|
695 |
}; |
}; |
713 |
'<tr' . $color[$i %2 ] . '> |
'<tr' . $color[$i %2 ] . '> |
714 |
<td class="fview">'; |
<td class="fview">'; |
715 |
|
|
716 |
# FIXME |
if (($backup->{'inc_size'} || 0) > 0) { |
|
$backup->{'fs_size'} = int($backup->{'size'} * 1024); |
|
|
|
|
|
if (($backup->{'fs_size'} || 0) > 0) { |
|
717 |
$retHTML .= ' |
$retHTML .= ' |
718 |
<input type="checkbox" name="fcb' . $checkbox_key . '" value="' . $checkbox_key . '" onClick="sumiraj(this);">'; |
<input type="checkbox" name="fcb' . $checkbox_key . '" value="' . $checkbox_key . '" onClick="sumiraj(this);">'; |
719 |
} |
} |
726 |
'<td align="center">' . epoch_to_iso( $backup->{'date'} ) . '</td>' . |
'<td align="center">' . epoch_to_iso( $backup->{'date'} ) . '</td>' . |
727 |
'<td align="center">' . $backup->{'age'} . '</td>' . |
'<td align="center">' . $backup->{'age'} . '</td>' . |
728 |
'<td align="right">' . $backup->{'size'} . '</td>' . |
'<td align="right">' . $backup->{'size'} . '</td>' . |
729 |
'<td align="right">' . $backup->{'fs_size'} . |
'<td align="right">' . $backup->{'inc_size'} . |
730 |
'<input type="hidden" iD="fss'.$checkbox_key .'" value="'. $backup->{'fs_size'} .'"></td>' . |
'<input type="hidden" iD="fss'.$checkbox_key .'" value="'. $backup->{'inc_size'} .'"></td>' . |
731 |
|
|
732 |
"</tr>\n"; |
"</tr>\n"; |
733 |
} |
} |