|
Lines 27-35
chdir $ENV{HOME} if (!(-r '.'));
Link Here
|
| 27 |
my $daemon_mode; |
27 |
my $daemon_mode; |
| 28 |
my $daemon_sleep = 5; |
28 |
my $daemon_sleep = 5; |
| 29 |
my $directory; |
29 |
my $directory; |
|
|
30 |
my $tempdir ; |
| 30 |
my $nosanitize; |
31 |
my $nosanitize; |
| 31 |
my $skip_export; |
32 |
my $skip_export; |
| 32 |
my $keep_export; |
33 |
my $keep_export; |
|
|
34 |
|
| 35 |
|
| 33 |
my $skip_index; |
36 |
my $skip_index; |
| 34 |
my $reset; |
37 |
my $reset; |
| 35 |
my $biblios; |
38 |
my $biblios; |
|
Lines 55-60
my $result = GetOptions(
Link Here
|
| 55 |
'daemon' => \$daemon_mode, |
58 |
'daemon' => \$daemon_mode, |
| 56 |
'sleep:i' => \$daemon_sleep, |
59 |
'sleep:i' => \$daemon_sleep, |
| 57 |
'd:s' => \$directory, |
60 |
'd:s' => \$directory, |
|
|
61 |
'td|tempdir:s' => \$tempdir, |
| 58 |
'r|reset' => \$reset, |
62 |
'r|reset' => \$reset, |
| 59 |
's' => \$skip_export, |
63 |
's' => \$skip_export, |
| 60 |
'k' => \$keep_export, |
64 |
'k' => \$keep_export, |
|
Lines 144-150
if ($verbose_logging >= 2) {
Link Here
|
| 144 |
my $use_tempdir = 0; |
148 |
my $use_tempdir = 0; |
| 145 |
unless ($directory) { |
149 |
unless ($directory) { |
| 146 |
$use_tempdir = 1; |
150 |
$use_tempdir = 1; |
| 147 |
$directory = tempdir(CLEANUP => ($keep_export ? 0 : 1)); |
151 |
$directory = tempdir( |
|
|
152 |
CLEANUP => ( $keep_export ? 0 : 1 ), |
| 153 |
DIR => ( $tempdir ? $tempdir : undef ), |
| 154 |
); |
| 155 |
} |
| 156 |
else { |
| 157 |
$directory = "$tempdir/$directory" if $tempdir; |
| 148 |
} |
158 |
} |
| 149 |
|
159 |
|
| 150 |
|
160 |
|
|
Lines 237-261
if ( $verbose_logging ) {
Link Here
|
| 237 |
print "CLEANING\n"; |
247 |
print "CLEANING\n"; |
| 238 |
print "====================\n"; |
248 |
print "====================\n"; |
| 239 |
} |
249 |
} |
|
|
250 |
|
| 240 |
if ($keep_export) { |
251 |
if ($keep_export) { |
| 241 |
print "NOTHING cleaned : the export $directory has been kept.\n"; |
252 |
print "NOTHING cleaned : the export directory $directory has been kept.\n"; |
| 242 |
print "You can re-run this script with the -s "; |
253 |
print "You can re-run this script with the -s "; |
| 243 |
if ($use_tempdir) { |
254 |
if ($use_tempdir) { |
| 244 |
print " and -d $directory parameters"; |
255 |
print " and -d $directory parameters"; |
| 245 |
} else { |
256 |
} |
| 246 |
print "parameter"; |
257 |
else { |
|
|
258 |
print " parameter"; |
| 247 |
} |
259 |
} |
| 248 |
print "\n"; |
260 |
print "\n"; |
| 249 |
print "if you just want to rebuild zebra after changing the record.abs\n"; |
261 |
print "if you just want to rebuild zebra after changing the record.abs\n"; |
| 250 |
print "or another zebra config file\n"; |
262 |
print "or another zebra config file\n"; |
| 251 |
} else { |
263 |
|
|
|
264 |
} |
| 265 |
else { |
| 266 |
# if we're using a random temporary directory |
| 267 |
# created by File::Temp, it will be removed |
| 268 |
# automatically. so we do nothing here... |
| 269 |
|
| 252 |
unless ($use_tempdir) { |
270 |
unless ($use_tempdir) { |
| 253 |
# if we're using a temporary directory |
271 |
|
| 254 |
# created by File::Temp, it will be removed |
272 |
# but if $use_tempdir, we remove it manually |
| 255 |
# automatically. |
273 |
rmtree( $directory, 0, 1 ); |
| 256 |
rmtree($directory, 0, 1); |
|
|
| 257 |
print "directory $directory deleted\n"; |
| 258 |
} |
274 |
} |
|
|
275 |
print "the export directory $directory has been deleted.\n" |
| 276 |
if $verbose_logging; |
| 259 |
} |
277 |
} |
| 260 |
|
278 |
|
| 261 |
sub do_one_pass { |
279 |
sub do_one_pass { |
|
Lines 865-870
Parameters:
Link Here
|
| 865 |
-r clear Zebra index before |
883 |
-r clear Zebra index before |
| 866 |
adding records to index. Implies -w. |
884 |
adding records to index. Implies -w. |
| 867 |
|
885 |
|
|
|
886 |
--tempdir Add a base directory for indexing. |
| 887 |
Note: Using this arg in conjuction with the -d arg, will create |
| 888 |
a directory under the path given with --tempdir |
| 889 |
so, --tempdir /mnt/100_gig -d koha1, creates an absolute path of /mnt/100_gig/koha1 |
| 890 |
|
| 868 |
-d Temporary directory for indexing. |
891 |
-d Temporary directory for indexing. |
| 869 |
If not specified, one is automatically |
892 |
If not specified, one is automatically |
| 870 |
created. The export directory |
893 |
created. The export directory |
| 871 |
- |
|
|