forked from andk/pause
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mldistwatch
executable file
·93 lines (60 loc) · 1.35 KB
/
mldistwatch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
#!/usr/local/bin/perl -w
=head1 NAME
mldistwatch - this is the pause indexer
=head1 SYNOPSIS
mldistwatch [OPTIONS]
=head1 OPTIONS
Usually called by cron. But occasionally called manually.
=over 8
=cut
my @opt =
map { /B<--(.+)>/ }
grep {s/^=item\s+//}
split /\n/, <<'=cut';
=item B<--debug_mem!>
Spits out noise about used memory
=item B<--skip-locking!>
skip locking (e.g. reindex if already indexed)
=item B<--logfile=s>
diag not to STDOUT but to this file
=item B<--pick=s@>
distro is a full path
=item B<--rewrite!>
do not index, only rewrite the index files
=item B<--sleep=i>
time to sleep at the end of big loop
=item B<--testhost!>
Setting testhost prevents sending mail; automatically sets skip-locking too.
=cut
=back
=head1 DESCRIPTION
(TBD)
=cut
use strict;
use lib "/home/k/PAUSE/lib";
use PAUSE::mldistwatch ();
use Getopt::Long ();
use Pod::Usage;
MAIN: {
umask 0002;
$|=1;
my %Opt;
Getopt::Long::GetOptions(
\%Opt,
@opt,
) or pod2usage(1);
if ($Opt{testhost}) {
$Opt{"skip-locking"} = 1;
}
my $mldw = PAUSE::mldistwatch->new(\%Opt);
if ($Opt{rewrite}) {
$mldw->rewrite_indexes;
} else {
$mldw->reindex;
}
}
exit;
#Local Variables:
#mode: cperl
#cperl-indent-level: 4
#End: