Author: poeml Date: Sat Nov 13 21:42:14 2010 New Revision: 8221 URL: http://svn.mirrorbrain.org/viewvc/mirrorbrain?rev=8221&view=rev Log: mb scan: - fix calculation of added/removed files after scanning only a subdirectory. Modified: trunk/tools/scanner.pl Modified: trunk/tools/scanner.pl URL: http://svn.mirrorbrain.org/viewvc/mirrorbrain/trunk/tools/scanner.pl?rev=8221&r1=8220&r2=8221&view=diff ============================================================================== --- trunk/tools/scanner.pl (original) +++ trunk/tools/scanner.pl Sat Nov 13 21:42:14 2010 _at_@ -348,11 +348,16 @@ $sql = "SELECT COUNT(*) FROM filearr WHERE $row->{id} = ANY(mirrors);"; print "$sql\n" if $sqlverbose; - $ary_ref = $dbh->selectall_arrayref($sql) or die $dbh->errstr(); - $file_count = defined($ary_ref->[0]) ? $ary_ref->[0][0] : 0; - print localtime(time) . " $row->{identifier}: total files after scan: $file_count " . - "(delta: " . ($file_count - $initial_file_count) . ")\n" if $verbose > -1; - + + if(length $start_dir) { + print localtime(time) . " $row->{identifier}: total files in '$start_dir' after scan: $file_count " . + "(delta: " . ($file_count - $initial_file_count) . ")\n" if $verbose > -1; + } else { + $ary_ref = $dbh->selectall_arrayref($sql) or die $dbh->errstr(); + $file_count = defined($ary_ref->[0]) ? $ary_ref->[0][0] : 0; + print localtime(time) . " $row->{identifier}: total files after scan: $file_count " . + "(delta: " . ($file_count - $initial_file_count) . ")\n" if $verbose > -1; + } $duration = time() - $start; print localtime(time) . " $row->{identifier}: purged old files in " . $duration . "s.\n" if $verbose > 0; _______________________________________________ mirrorbrain-commits mailing list Archive: http://mirrorbrain.org/archive/mirrorbrain-commits/ Note: To remove yourself from this list, send a mail with the content unsubscribe to the address mirrorbrain-commits-request_at_mirrorbrain.orgReceived on Sat Nov 13 2010 - 20:42:17 GMT
This archive was generated by hypermail 2.3.0 : Sat Nov 13 2010 - 20:47:13 GMT