View | Details | Raw Unified | Return to bug 8745
Collapse All | Expand All

(-)a/misc/migration_tools/rebuild_zebra.pl (-3 / +25 lines)
Lines 12-17 use C4::AuthoritiesMarc; Link Here
12
use C4::Items;
12
use C4::Items;
13
use Koha::RecordProcessor;
13
use Koha::RecordProcessor;
14
14
15
16
17
use Smart::Comments;
15
# 
18
# 
16
# script that checks zebradir structure & create directories & mandatory files if needed
19
# script that checks zebradir structure & create directories & mandatory files if needed
17
#
20
#
Lines 39-44 my $do_not_clear_zebraqueue; Link Here
39
my $length;
42
my $length;
40
my $where;
43
my $where;
41
my $offset;
44
my $offset;
45
my $run_as_root;
46
my $run_user = (getpwuid($<))[0];
47
###  $run_user
48
###  $run_as_root
49
50
42
my $verbose_logging = 0;
51
my $verbose_logging = 0;
43
my $zebraidx_log_opt = " -v none,fatal,warn ";
52
my $zebraidx_log_opt = " -v none,fatal,warn ";
44
my $result = GetOptions(
53
my $result = GetOptions(
Lines 46-52 my $result = GetOptions( Link Here
46
    'r|reset'       => \$reset,
55
    'r|reset'       => \$reset,
47
    's'             => \$skip_export,
56
    's'             => \$skip_export,
48
    'k'             => \$keep_export,
57
    'k'             => \$keep_export,
49
    'I|skip-index'    => \$skip_index,
58
    'I|skip-index'  => \$skip_index,
50
    'nosanitize'    => \$nosanitize,
59
    'nosanitize'    => \$nosanitize,
51
    'b'             => \$biblios,
60
    'b'             => \$biblios,
52
    'noxml'         => \$noxml,
61
    'noxml'         => \$noxml,
Lines 61-73 my $result = GetOptions( Link Here
61
    'length:i'        => \$length,
70
    'length:i'        => \$length,
62
    'offset:i'      => \$offset,
71
    'offset:i'      => \$offset,
63
    'v+'             => \$verbose_logging,
72
    'v+'             => \$verbose_logging,
73
    'run-as-root'    => \$run_as_root,
64
);
74
);
65
75
66
67
if (not $result or $want_help) {
76
if (not $result or $want_help) {
68
    print_usage();
77
    print_usage();
69
    exit 0;
78
    exit 0;
70
}
79
}
80
###  $run_user
81
###  $run_as_root
82
83
84
if( undef  $run_as_root and $run_user eq 'root') {
85
    my $msg = "Warning: You are running this script as the user 'root'.\n";
86
    $msg   .= "If this is intentional you must explicitly specify this using the -run-as-root switch\n";
87
    $msg   .= "Please do '$0 --help' to see usage.\n";
88
    die $msg;
89
}
71
90
72
if (not $biblios and not $authorities) {
91
if (not $biblios and not $authorities) {
73
    my $msg = "Must specify -b or -a to reindex bibs or authorities\n";
92
    my $msg = "Must specify -b or -a to reindex bibs or authorities\n";
Lines 657-662 only if you are using Zebra; if you are using the 'NoZebra' Link Here
657
mode, this job should not be used.
676
mode, this job should not be used.
658
677
659
Parameters:
678
Parameters:
679
660
    -b                      index bibliographic records
680
    -b                      index bibliographic records
661
681
662
    -a                      index authority records
682
    -a                      index authority records
Lines 716-721 Parameters: Link Here
716
736
717
    --munge-config          Deprecated option to try
737
    --munge-config          Deprecated option to try
718
                            to fix Zebra config files.
738
                            to fix Zebra config files.
739
740
    --run-as-root           explicitily allow script to run as 'root' user
741
719
    --help or -h            show this message.
742
    --help or -h            show this message.
720
_USAGE_
743
_USAGE_
721
}
744
}
722
- 

Return to bug 8745