Lines 84-89
Usage: $0 [-h|--help] [--confirm] [--sessions] [--sessdays DAYS] [-v|--verbose]
Link Here
|
84 |
or equal to 1. |
84 |
or equal to 1. |
85 |
--log-modules Specify which action log modules to trim. Repeatable. |
85 |
--log-modules Specify which action log modules to trim. Repeatable. |
86 |
--preserve-log Specify which action logs to exclude. Repeatable. |
86 |
--preserve-log Specify which action logs to exclude. Repeatable. |
|
|
87 |
--log-action Specify which action log action entries to trim. Repeatable. |
87 |
--logs DAYS purge entries from action_logs older than DAYS days. |
88 |
--logs DAYS purge entries from action_logs older than DAYS days. |
88 |
Defaults to 180 days if no days specified. |
89 |
Defaults to 180 days if no days specified. |
89 |
--searchhistory DAYS purge entries from search_history older than DAYS days. |
90 |
--searchhistory DAYS purge entries from search_history older than DAYS days. |
Lines 162-167
my $labels;
Link Here
|
162 |
my $cards; |
163 |
my $cards; |
163 |
my @log_modules; |
164 |
my @log_modules; |
164 |
my @preserve_logs; |
165 |
my @preserve_logs; |
|
|
166 |
my @log_actions; |
165 |
my $jobs_days; |
167 |
my $jobs_days; |
166 |
my @jobs_types; |
168 |
my @jobs_types; |
167 |
my $reports; |
169 |
my $reports; |
Lines 183-188
GetOptions(
Link Here
|
183 |
'logs:i' => \$pLogs, |
185 |
'logs:i' => \$pLogs, |
184 |
'log-module:s' => \@log_modules, |
186 |
'log-module:s' => \@log_modules, |
185 |
'preserve-log:s' => \@preserve_logs, |
187 |
'preserve-log:s' => \@preserve_logs, |
|
|
188 |
'log-action:s' => \@log_actions, |
186 |
'messages:i' => \$pMessages, |
189 |
'messages:i' => \$pMessages, |
187 |
'fees:i' => \$fees_days, |
190 |
'fees:i' => \$fees_days, |
188 |
'searchhistory:i' => \$pSearchhistory, |
191 |
'searchhistory:i' => \$pSearchhistory, |
Lines 386-391
if ($pLogs) {
Link Here
|
386 |
$log_query .= " AND module IN (" . join(',',('?') x @log_modules ) . ")"; |
389 |
$log_query .= " AND module IN (" . join(',',('?') x @log_modules ) . ")"; |
387 |
push @query_params, @log_modules; |
390 |
push @query_params, @log_modules; |
388 |
} |
391 |
} |
|
|
392 |
if( @log_actions ){ |
393 |
$log_query .= " AND action IN (" . join(',',('?') x @log_actions ) . ")"; |
394 |
push @query_params, @log_actions; |
395 |
} |
389 |
$sth = $dbh->prepare( $log_query ); |
396 |
$sth = $dbh->prepare( $log_query ); |
390 |
if ( $confirm ) { |
397 |
if ( $confirm ) { |
391 |
$sth->execute($pLogs, @query_params) or die $dbh->errstr; |
398 |
$sth->execute($pLogs, @query_params) or die $dbh->errstr; |
392 |
- |
|
|