Sometimes zebra indexing will fail when the filesystem of the /tmp dir is too small for the indexing temp file ie: a 20 gig temp file is needed, and /tmp is only 1 gig :( ...in this situation, it is necessary to tell rebuild_zebra.pl to use a different filesystem with the required space. this patch aims to provide this functionality
Created attachment 42279 [details] [review] Bug 12120: Add --tempdir arg to rebuild_zebra.pl Sometimes zebra indexing will fail when the filesystem of the /tmp dir is too small for the indexing temp file ie: a 20 gig temp file is needed, and /tmp is only 1 gig :( in this situation, it is necessary to tell rebuild_zebra.pl to use a different filesystem with the required space. Test plan... run 3 zebra indexing tests, with different args 1/ test an index, with no args $ sudo koha-shell -c ' /home/mason/git/koha/master/misc/migration_tools/rebuild_zebra.pl -b -v -z' koha1 | grep 'export directory' the export directory /tmp/jp1d1RmCzL has been deleted. 2/ test an index, with a --tempdir arg $ sudo koha-shell -c ' /home/mason/git/koha/master/misc/migration_tools/rebuild_zebra.pl -b -v -z --tempdir /tmp1/aa1' koha1 | grep 'export directory' the export directory /tmp1/aa1/FEOKJIzPcA has been deleted. 3/ test an index, with both --tempdir and -d (directory) args $ sudo koha-shell -c ' /home/mason/git/koha/master/misc/migration_tools/rebuild_zebra.pl -b -v -z --tempdir /tmp1/aa1 -d bb1' koha1 | grep 'export directory' the export directory /tmp1/aa1/bb1 has been deleted. Note that the 'export directory' path is as expected, for each test run
mtompset@debian:~/kohaclone$ git checkout master Switched to branch 'master' Your branch is up-to-date with 'origin/master'. mtompset@debian:~/kohaclone$ git branch -D bug_12120 Deleted branch bug_12120 (was 134a7f2). mtompset@debian:~/kohaclone$ git checkout -b bug_12120 origin/master Branch bug_12120 set up to track remote branch master from origin. Switched to a new branch 'bug_12120' mtompset@debian:~/kohaclone$ git bz apply 12120 Bug 12120 - Add --tempdir arg to rebuild_zebra.pl 42279 - Bug 12120: Add --tempdir arg to rebuild_zebra.pl Apply? [(y)es, (n)o, (i)nteractive] y Applying: Bug 12120: Add --tempdir arg to rebuild_zebra.pl mtompset@debian:~/kohaclone$ ./misc/migration_tools/rebuild_zebra.pl -b -a -r -v --tempdir /tmp/a/b/c/d/e/f/g Error in tempdir() using /tmp/a/b/c/d/e/f/g/XXXXXXXXXX: Parent directory (/tmp/a/b/c/d/e/f/g) does not exist at ./misc/migration_tools/rebuild_zebra.pl line 160. mtompset@debian:~/kohaclone$