]> Sergey Matveev's repositories - public-inbox.git/blobdiff - script/public-inbox-xcpdb
xcpdb: support --no-fsync from CLI
[public-inbox.git] / script / public-inbox-xcpdb
index b41c683bb86267d8c595b8bb6b3cbee8e98c0028..2c91598cb4e9a51039d4fbf691fa533161387f40 100755 (executable)
@@ -1,5 +1,5 @@
 #!/usr/bin/perl -w
-# Copyright (C) 2019 all contributors <meta@public-inbox.org>
+# Copyright (C) 2019-2020 all contributors <meta@public-inbox.org>
 # License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
 # xcpdb: Xapian copy database, a wrapper around Xapian's copydatabase(1)
 use Getopt::Long qw(:config gnu_getopt no_ignore_case auto_abbrev);
@@ -8,8 +8,9 @@ use PublicInbox::Xapcmd;
 use PublicInbox::Admin;
 PublicInbox::Admin::require_or_die('-search');
 my $usage = "Usage: public-inbox-xcpdb [--compact] INBOX_DIR\n";
-my $opt = {};
-my @opt = (qw(compact reshard|R=i), @PublicInbox::Xapcmd::COMPACT_OPT);
+my $opt = { fsync => 1 };
+my @opt = (qw(fsync|sync! compact reshard|R=i),
+       @PublicInbox::Xapcmd::COMPACT_OPT);
 GetOptions($opt, @opt) or die "bad command-line args\n$usage";
 my @ibxs = PublicInbox::Admin::resolve_inboxes(\@ARGV) or die $usage;
 foreach (@ibxs) {