--batch-size=BYTES flush changes to OS after a given number of bytes
--max-size=BYTES do not index messages larger than the given size
--gc perform garbage collection instead of indexing
--batch-size=BYTES flush changes to OS after a given number of bytes
--max-size=BYTES do not index messages larger than the given size
--gc perform garbage collection instead of indexing
BYTES may use `k', `m', and `g' suffixes (e.g. `10m' for 10 megabytes)
See public-inbox-extindex(1) man page for full documentation.
EOF
my $opt = { quiet => -1, compact => 0, fsync => 1, scan => 1 };
GetOptions($opt, qw(verbose|v+ reindex rethread compact|c+ jobs|j=i
BYTES may use `k', `m', and `g' suffixes (e.g. `10m' for 10 megabytes)
See public-inbox-extindex(1) man page for full documentation.
EOF
my $opt = { quiet => -1, compact => 0, fsync => 1, scan => 1 };
GetOptions($opt, qw(verbose|v+ reindex rethread compact|c+ jobs|j=i
or die $help;
if ($opt->{help}) { print $help; exit 0 };
die "--jobs must be >= 0\n" if defined $opt->{jobs} && $opt->{jobs} < 0;
or die $help;
if ($opt->{help}) { print $help; exit 0 };
die "--jobs must be >= 0\n" if defined $opt->{jobs} && $opt->{jobs} < 0;
local $SIG{USR1} = 'IGNORE'; # to be overridden in eidx_sync
# require lazily to speed up --help
require PublicInbox::Admin;
local $SIG{USR1} = 'IGNORE'; # to be overridden in eidx_sync
# require lazily to speed up --help
require PublicInbox::Admin;
my $cfg = PublicInbox::Config->new;
my $eidx_dir = shift(@ARGV);
unless (defined $eidx_dir) {
my $cfg = PublicInbox::Config->new;
my $eidx_dir = shift(@ARGV);
unless (defined $eidx_dir) {
- die "E: --all not compatible with --gc\n" if $opt->{all};
- die "E: --watch is not compatible with --gc\n" if $opt->{watch};
+ for my $sw (qw(all watch dry-run dedupe)) {
+ die "E: --$sw is not compatible with --gc\n" if $opt->{$sw};
+ }
PublicInbox::Admin::require_or_die(qw(-search));
PublicInbox::Config::json() or die "Cpanel::JSON::XS or similar missing\n";
PublicInbox::Admin::progress_prepare($opt);
PublicInbox::Admin::require_or_die(qw(-search));
PublicInbox::Config::json() or die "Cpanel::JSON::XS or similar missing\n";
PublicInbox::Admin::progress_prepare($opt);