Lines 79-84
Usage: $0 [-h|--help] [--confirm] [--sessions] [--sessdays DAYS] [-v|--verbose]
Link Here
|
79 |
or equal to 1. |
79 |
or equal to 1. |
80 |
--log-modules Specify which action log modules to trim. Repeatable. |
80 |
--log-modules Specify which action log modules to trim. Repeatable. |
81 |
--preserve-log Specify which action logs to exclude. Repeatable. |
81 |
--preserve-log Specify which action logs to exclude. Repeatable. |
|
|
82 |
--log-action Specify which action log action entries to trim. Repeatable. |
82 |
--logs DAYS purge entries from action_logs older than DAYS days. |
83 |
--logs DAYS purge entries from action_logs older than DAYS days. |
83 |
Defaults to 180 days if no days specified. |
84 |
Defaults to 180 days if no days specified. |
84 |
--searchhistory DAYS purge entries from search_history older than DAYS days. |
85 |
--searchhistory DAYS purge entries from search_history older than DAYS days. |
Lines 154-159
my $labels;
Link Here
|
154 |
my $cards; |
155 |
my $cards; |
155 |
my @log_modules; |
156 |
my @log_modules; |
156 |
my @preserve_logs; |
157 |
my @preserve_logs; |
|
|
158 |
my @log_actions; |
157 |
my $jobs_days; |
159 |
my $jobs_days; |
158 |
my @jobs_types; |
160 |
my @jobs_types; |
159 |
|
161 |
|
Lines 173-178
GetOptions(
Link Here
|
173 |
'logs:i' => \$pLogs, |
175 |
'logs:i' => \$pLogs, |
174 |
'log-module:s' => \@log_modules, |
176 |
'log-module:s' => \@log_modules, |
175 |
'preserve-log:s' => \@preserve_logs, |
177 |
'preserve-log:s' => \@preserve_logs, |
|
|
178 |
'log-action:s' => \@log_actions, |
176 |
'messages:i' => \$pMessages, |
179 |
'messages:i' => \$pMessages, |
177 |
'fees:i' => \$fees_days, |
180 |
'fees:i' => \$fees_days, |
178 |
'searchhistory:i' => \$pSearchhistory, |
181 |
'searchhistory:i' => \$pSearchhistory, |
Lines 371-376
if ($pLogs) {
Link Here
|
371 |
$log_query .= " AND module IN (" . join(',',('?') x @log_modules ) . ")"; |
374 |
$log_query .= " AND module IN (" . join(',',('?') x @log_modules ) . ")"; |
372 |
push @query_params, @log_modules; |
375 |
push @query_params, @log_modules; |
373 |
} |
376 |
} |
|
|
377 |
if( @log_actions ){ |
378 |
$log_query .= " AND action IN (" . join(',',('?') x @log_actions ) . ")"; |
379 |
push @query_params, @log_actions; |
380 |
} |
374 |
$sth = $dbh->prepare( $log_query ); |
381 |
$sth = $dbh->prepare( $log_query ); |
375 |
if ( $confirm ) { |
382 |
if ( $confirm ) { |
376 |
$sth->execute($pLogs, @query_params) or die $dbh->errstr; |
383 |
$sth->execute($pLogs, @query_params) or die $dbh->errstr; |
377 |
- |
|
|