Bug 28555: (follow-up) Make verbose count flags passed
[koha-ffzg.git] / misc / cronjobs / cleanup_database.pl
index 74505cf..dc62ef8 100755 (executable)
@@ -75,7 +75,7 @@ Usage: $0 [-h|--help] [--confirm] [--sessions] [--sessdays DAYS] [-v|--verbose]
                       In the case of --fees, DAYS must be greater than
                       or equal to 1.
    --log-modules      Specify which action log modules to trim. Repeatable.
-   --preserve-logs    Specify which action logs to exclude. Repeatable.
+   --preserve-log     Specify which action logs to exclude. Repeatable.
    --logs DAYS        purge entries from action_logs older than DAYS days.
                       Defaults to 180 days if no days specified.
    --searchhistory DAYS  purge entries from search_history older than DAYS days.
@@ -149,6 +149,8 @@ my $cards;
 my @log_modules;
 my @preserve_logs;
 
+my $command_line_options = join(" ",@ARGV);
+
 GetOptions(
     'h|help'            => \$help,
     'confirm'           => \$confirm,
@@ -249,7 +251,7 @@ if ($pDebarments && $allDebarments) {
 
 say "Confirm flag not passed, running in dry-run mode..." unless $confirm;
 
-cronlogaction() unless $confirm;
+cronlogaction({ info => $command_line_options });
 
 my $dbh = C4::Context->dbh();
 my $sth;
@@ -673,6 +675,8 @@ if ($cards) {
     }
 }
 
+cronlogaction({ action => 'End', info => "COMPLETED" });
+
 exit(0);
 
 sub RemoveOldSessions {