use constant BPC_FTYPE_DIR => 5;
use constant EST_CHUNK => 100000;
+# daylight saving time change offset for 1h
+my $dst_offset = 60 * 60;
+
my $debug = 0;
$|=1;
my %opt;
-if ( !getopts("cdm:v:ij", \%opt ) ) {
+if ( !getopts("cdm:v:ijf", \%opt ) ) {
print STDERR <<EOF;
-usage: $0 [-c|-d] [-m num] [-v|-v level] [-i]
+usage: $0 [-c|-d] [-m num] [-v|-v level] [-i|-j|-f]
Options:
-c create database on first use
-v num set verbosity (debug) level (default $debug)
-i update Hyper Estraier full text index
-j update full text, don't check existing files
+ -f don't do anything with full text index
Option -j is variation on -i. It will allow faster initial creation
of full-text index from existing database.
+Option -f will create database which is out of sync with full text index. You
+will have to re-run $0 with -i to fix it.
+
EOF
exit 1;
}
if ($opt{v}) {
print "Debug level at $opt{v}\n";
$debug = $opt{v};
+} elsif ($opt{f}) {
+ print "WARNING: disabling full-text index update. You need to re-run $0 -j !\n";
+ ($use_hest, $index_path, $index_node_url) = (undef, undef, undef);
}
#---- subs ----
SELECT 1 FROM files
WHERE shareID = ? and
path = ? and
- date = ? and
- size = ?
+ size = ? and
+ ( date = ? or date = ? or date = ? )
LIMIT 1
});
- my @param = ($shareID,$path,$date,$size);
+ my @param = ($shareID,$path,$size,$date, $date-$dst_offset, $date+$dst_offset);
$sth->{file_in_db}->execute(@param);
my $rows = $sth->{file_in_db}->rows;
print STDERR "## found_in_db($shareID,$path,$date,$size) ",( $rows ? '+' : '-' ), join(" ",@param), "\n" if ($debug >= 3);
$filesInBackup->{$path_key}->{'size'}
));
- # daylight saving time change offset for 1h
- my $dst_offset = 60 * 60;
-
my $key_dst_prev = join(" ", (
$shareID,
$dir,