@@ -, +, @@ --- misc/cronjobs/cleanup_database.pl | 7 +++++++ 1 file changed, 7 insertions(+) --- a/misc/cronjobs/cleanup_database.pl +++ a/misc/cronjobs/cleanup_database.pl @@ -79,6 +79,7 @@ Usage: $0 [-h|--help] [--confirm] [--sessions] [--sessdays DAYS] [-v|--verbose] or equal to 1. --log-modules Specify which action log modules to trim. Repeatable. --preserve-log Specify which action logs to exclude. Repeatable. + --log-action Specify which action log action entries to trim. 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. @@ -154,6 +155,7 @@ my $labels; my $cards; my @log_modules; my @preserve_logs; +my @log_actions; my $jobs_days; my @jobs_types; @@ -173,6 +175,7 @@ GetOptions( 'logs:i' => \$pLogs, 'log-module:s' => \@log_modules, 'preserve-log:s' => \@preserve_logs, + 'log-action:s' => \@log_actions, 'messages:i' => \$pMessages, 'fees:i' => \$fees_days, 'searchhistory:i' => \$pSearchhistory, @@ -371,6 +374,10 @@ if ($pLogs) { $log_query .= " AND module IN (" . join(',',('?') x @log_modules ) . ")"; push @query_params, @log_modules; } + if( @log_actions ){ + $log_query .= " AND action IN (" . join(',',('?') x @log_actions ) . ")"; + push @query_params, @log_actions; + } $sth = $dbh->prepare( $log_query ); if ( $confirm ) { $sth->execute($pLogs, @query_params) or die $dbh->errstr; --