Make json folder cleanup optional

Change-Id: Icdb1d8d3e308c252e91135d7c41932b36dd6c9a2
diff --git a/bin/corpuslist_to_index b/bin/corpuslist_to_index
index 2d05ca2..260c9c3 100644
--- a/bin/corpuslist_to_index
+++ b/bin/corpuslist_to_index
@@ -26,6 +26,7 @@
   'index-dir|id=s' => \(my $index_dir = '/export/netapp/korap/korap-head-02/index-2020-03-30/index'),
   'index-conf|ic=s' => \(my $index_conf = 'kustvakt.conf'),
   'slack=s' => \(my $slack = ''),
+  'cleanup!' => \(my $cleanup_json = 1),
   'cmd|c=s' => \@cmds,
   'comment=s' => \(my $comment),
   'help|h' => sub {
@@ -153,9 +154,11 @@
   };
 
   # Cleanup json directory
-  say 'rm -r ' . $json_dir;
-  say 'mkdir ' . $json_dir unless $final;
-  say "\n";
+  if ($cleanup_json) {
+    say 'rm -r ' . $json_dir;
+    say 'mkdir ' . $json_dir unless $final;
+    say "\n";
+  };
 };
 
 
@@ -215,6 +218,10 @@
 
 Add comment that is added to all reportings.
 
+=item B<--(no)cleanup>
+
+Clean up the json folder after indexation.
+
 =back
 
 =cut