+PublicInbox::Admin::require_or_die(keys %$mods);
+my $env = PublicInbox::Admin::index_prepare($opt, $cfg);
+local %ENV = (%ENV, %$env) if $env;
+require PublicInbox::InboxWritable;
+PublicInbox::Admin::progress_prepare($opt);
+for my $ibx (@ibxs) {
+ $ibx = PublicInbox::InboxWritable->new($ibx);
+ if ($opt->{compact} >= 2) {
+ PublicInbox::Xapcmd::run($ibx, 'compact', $opt->{compact_opt});
+ }
+ $ibx->{-no_fsync} = 1 if !$opt->{fsync};
+ $ibx->{-skip_docdata} //= $opt->{'skip-docdata'};
+
+ my $ibx_opt = $opt;
+ if (defined(my $s = $ibx->{lc('indexSequentialShard')})) {
+ defined(my $v = $cfg->git_bool($s)) or die <<EOL;
+publicInbox.$ibx->{name}.indexSequentialShard not boolean
+EOL
+ $ibx_opt = { %$opt, sequential_shard => $v };
+ }
+ PublicInbox::Admin::index_inbox($ibx, undef, $ibx_opt);
+ if (my $copt = $opt->{compact_opt}) {
+ local $copt->{jobs} = 0 if $ibx_opt->{sequential_shard};
+ PublicInbox::Xapcmd::run($ibx, 'compact', $copt);