Bug 41888

Summary: Cronjob cleanup_database.pl doesn't delete old jobs either by age or type
Product: Koha Reporter: Anke Bruns <anke.bruns>
Component: Command-line UtilitiesAssignee: Bugs List <koha-bugs>
Status: NEW --- QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: robin
Version: 24.11   
Hardware: Other   
OS: Linux   
GIT URL: Initiative type: ---
Sponsorship status: --- Comma delimited list of Sponsors:
Crowdfunding goal: 0 Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:

Description Anke Bruns 2026-02-19 16:53:26 UTC
The command 

perl /usr/share/koha/bin/cronjobs/cleanup_database.pl --confirm --jobs-days 7 --jobs-type all <instance> 

and several variations (e.g. only jobs-days or jobs-type parameter) does not purge any old jobs.

What may be the reason?

The solution in https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30914 was to fix 'delete if $verbose' and set 'delete if $confirm' instead, but I couldn't find the same mistake here.

The cleanup seems to fail also when the job runs as a cronjob in koha-common.