--- /dev/null
+#!/usr/local/bin/perl
+use strict;
+no utf8;
+
+use lib "/data/backuppc-agi//lib";
+use DBI;
+use BackupPC::Lib;
+
+my $bpc = BackupPC::Lib->new || die "can't create BackupPC::Lib";
+my %Conf = $bpc->Conf();
+
+my $dsn = $Conf{SearchDSN} || die "need searchdsn in config.pl\n";
+my $user = $Conf{SearchUser} || '';
+my $dbh = DBI->connect($dsn, $user, "", { raiseerror => 1, autocommit => 0 });
+my $tar_dir = $Conf{InstallDir}.'/'.$Conf{GzipTempDir};
+my $dvd_nr = $ARGV[0];
+
+if (!defined($dvd_nr)) {
+ print q{
+ No dvd_nr parameter!
+ Usage:
+ $0 <dvd_nr>
+ };
+ exit(0);
+}
+
+my $sql = q{
+ SELECT *
+ FROM backups_on_dvds
+ WHERE dvd_nr = ?
+};
+my $sth = $dbh->prepare($sql);
+$sth->execute($dvd_nr);
+while (my $row = $sth->fetchrow_hashref()) {
+ my $host_share = $row->{share};
+ $host_share =~ s/(.*?):(.*)/$1_$2_/gi;
+ my $filename = $tar_dir."/".$host_share . $row->{num}.".tar.gz";
+ my (undef, undef, undef, undef, undef, undef, undef, $fs_size, undef, undef, undef, undef, undef) = stat($filename);
+ print "checking $filename...";
+ if ($fs_size != $row->{gzip_size}) {
+ print "INVALID: fs_size: $fs_size, db_size: ".$row->{gzip_size}."\n";
+ } else {
+ print "ok\n";
+ }
+
+}
+$sth->finish();
+$dbh->disconnect();
+
+