View | Details | Raw Unified | Return to bug 26831
Collapse All | Expand All

(-)a/misc/cronjobs/cleanup_database.pl (-4 / +17 lines)
Lines 89-96 Usage: $0 [-h|--help] [--confirm] [--sessions] [--sessdays DAYS] [-v|--verbose] Link Here
89
                      Defaults to 180 days if no days specified.
89
                      Defaults to 180 days if no days specified.
90
   --searchhistory DAYS  purge entries from search_history older than DAYS days.
90
   --searchhistory DAYS  purge entries from search_history older than DAYS days.
91
                         Defaults to 30 days if no days specified
91
                         Defaults to 30 days if no days specified
92
   --list-invites  DAYS  purge (unaccepted) list share invites older than DAYS
92
   --list-invites  DAYS  purge (unaccepted) list share invites older than DAYS days.
93
                         days.  Defaults to 14 days if no days specified.
93
                         This parameter is prioritised over the
94
                         PurgeListShareInvitesOlderThan system preference.
95
                         Defaults to 14 days if no days specified for this parameter and
96
                         the PurgeListShareInvitesOlderThan system preference is empty.
94
   --restrictions DAYS   purge patrons restrictions expired since more than DAYS days.
97
   --restrictions DAYS   purge patrons restrictions expired since more than DAYS days.
95
                         Defaults to 30 days if no days specified.
98
                         Defaults to 30 days if no days specified.
96
   --all-restrictions   purge all expired patrons restrictions.
99
   --all-restrictions   purge all expired patrons restrictions.
Lines 224-236 $pLogs = DEFAULT_LOGS_PURGEDAYS if defined($pLogs) Link Here
224
$zebraqueue_days   = DEFAULT_ZEBRAQ_PURGEDAYS             if defined($zebraqueue_days)   && $zebraqueue_days == 0;
227
$zebraqueue_days   = DEFAULT_ZEBRAQ_PURGEDAYS             if defined($zebraqueue_days)   && $zebraqueue_days == 0;
225
$mail              = DEFAULT_MAIL_PURGEDAYS               if defined($mail)              && $mail == 0;
228
$mail              = DEFAULT_MAIL_PURGEDAYS               if defined($mail)              && $mail == 0;
226
$pSearchhistory    = DEFAULT_SEARCHHISTORY_PURGEDAYS      if defined($pSearchhistory)    && $pSearchhistory == 0;
229
$pSearchhistory    = DEFAULT_SEARCHHISTORY_PURGEDAYS      if defined($pSearchhistory)    && $pSearchhistory == 0;
227
$pListShareInvites = DEFAULT_SHARE_INVITATION_EXPIRY_DAYS if defined($pListShareInvites) && $pListShareInvites == 0;
228
$pDebarments       = DEFAULT_DEBARMENTS_PURGEDAYS         if defined($pDebarments)       && $pDebarments == 0;
230
$pDebarments       = DEFAULT_DEBARMENTS_PURGEDAYS         if defined($pDebarments)       && $pDebarments == 0;
229
$pMessages         = DEFAULT_MESSAGES_PURGEDAYS           if defined($pMessages)         && $pMessages == 0;
231
$pMessages         = DEFAULT_MESSAGES_PURGEDAYS           if defined($pMessages)         && $pMessages == 0;
230
$jobs_days         = DEFAULT_JOBS_PURGEDAYS               if defined($jobs_days)         && $jobs_days == 0;
232
$jobs_days         = DEFAULT_JOBS_PURGEDAYS               if defined($jobs_days)         && $jobs_days == 0;
231
@jobs_types        = (DEFAULT_JOBS_PURGETYPES)            if $jobs_days                  && @jobs_types == 0;
233
@jobs_types        = (DEFAULT_JOBS_PURGETYPES)            if $jobs_days                  && @jobs_types == 0;
232
$edifact_msg_days  = DEFAULT_EDIFACT_MSG_PURGEDAYS        if defined($edifact_msg_days)  && $edifact_msg_days == 0;
234
$edifact_msg_days  = DEFAULT_EDIFACT_MSG_PURGEDAYS        if defined($edifact_msg_days)  && $edifact_msg_days == 0;
233
235
236
# Choose the number of days at which to purge unaccepted list invites:
237
# - DAYS defined in the list-invites parameter is prioritised first
238
# - PurgeListShareInvitesOlderThan system preference is prioritised second
239
# - Default value of 14 days is prioritised last - if the list-invites parameter is passed without a DAYS value and the PurgeListShareInvitesOlderThan syspref is empty.
240
if ( !defined($pListShareInvites) ) {
241
    if ( C4::Context->preference('PurgeListShareInvitesOlderThan') ) {
242
        $pListShareInvites = C4::Context->preference('PurgeListShareInvitesOlderThan');
243
    }
244
} elsif ( defined($pListShareInvites) && $pListShareInvites == 0 ) {
245
    $pListShareInvites = DEFAULT_SHARE_INVITATION_EXPIRY_DAYS;
246
}
247
234
if ($help) {
248
if ($help) {
235
    usage(0);
249
    usage(0);
236
}
250
}
237
- 

Return to bug 26831