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

(-)a/misc/migration_tools/rebuild_zebra.pl (-4 / +22 lines)
Lines 13-19 use C4::Items; Link Here
13
use Koha::RecordProcessor;
13
use Koha::RecordProcessor;
14
use XML::LibXML;
14
use XML::LibXML;
15
15
16
# 
17
# script that checks zebradir structure & create directories & mandatory files if needed
16
# script that checks zebradir structure & create directories & mandatory files if needed
18
#
17
#
19
#
18
#
Lines 40-45 my $do_not_clear_zebraqueue; Link Here
40
my $length;
39
my $length;
41
my $where;
40
my $where;
42
my $offset;
41
my $offset;
42
my $run_as_root;
43
my $run_user = (getpwuid($<))[0];
44
###  $run_user
45
###  $run_as_root
46
47
43
my $verbose_logging = 0;
48
my $verbose_logging = 0;
44
my $zebraidx_log_opt = " -v none,fatal,warn ";
49
my $zebraidx_log_opt = " -v none,fatal,warn ";
45
my $result = GetOptions(
50
my $result = GetOptions(
Lines 47-53 my $result = GetOptions( Link Here
47
    'r|reset'       => \$reset,
52
    'r|reset'       => \$reset,
48
    's'             => \$skip_export,
53
    's'             => \$skip_export,
49
    'k'             => \$keep_export,
54
    'k'             => \$keep_export,
50
    'I|skip-index'    => \$skip_index,
55
    'I|skip-index'  => \$skip_index,
51
    'nosanitize'    => \$nosanitize,
56
    'nosanitize'    => \$nosanitize,
52
    'b'             => \$biblios,
57
    'b'             => \$biblios,
53
    'noxml'         => \$noxml,
58
    'noxml'         => \$noxml,
Lines 62-74 my $result = GetOptions( Link Here
62
    'length:i'        => \$length,
67
    'length:i'        => \$length,
63
    'offset:i'      => \$offset,
68
    'offset:i'      => \$offset,
64
    'v+'             => \$verbose_logging,
69
    'v+'             => \$verbose_logging,
70
    'run-as-root'    => \$run_as_root,
65
);
71
);
66
72
67
68
if (not $result or $want_help) {
73
if (not $result or $want_help) {
69
    print_usage();
74
    print_usage();
70
    exit 0;
75
    exit 0;
71
}
76
}
77
###  $run_user
78
###  $run_as_root
79
80
81
if( undef  $run_as_root and $run_user eq 'root') {
82
    my $msg = "Warning: You are running this script as the user 'root'.\n";
83
    $msg   .= "If this is intentional you must explicitly specify this using the -run-as-root switch\n";
84
    $msg   .= "Please do '$0 --help' to see usage.\n";
85
    die $msg;
86
}
72
87
73
if (not $biblios and not $authorities) {
88
if (not $biblios and not $authorities) {
74
    my $msg = "Must specify -b or -a to reindex bibs or authorities\n";
89
    my $msg = "Must specify -b or -a to reindex bibs or authorities\n";
Lines 679-684 Use this batch job to reindex all biblio or authority Link Here
679
records in your Koha database.
694
records in your Koha database.
680
695
681
Parameters:
696
Parameters:
697
682
    -b                      index bibliographic records
698
    -b                      index bibliographic records
683
699
684
    -a                      index authority records
700
    -a                      index authority records
Lines 738-743 Parameters: Link Here
738
754
739
    --munge-config          Deprecated option to try
755
    --munge-config          Deprecated option to try
740
                            to fix Zebra config files.
756
                            to fix Zebra config files.
757
758
    --run-as-root           explicitily allow script to run as 'root' user
759
741
    --help or -h            show this message.
760
    --help or -h            show this message.
742
_USAGE_
761
_USAGE_
743
}
762
}
744
- 

Return to bug 8745