@@ -, +, @@ $ koha-mysql kohadev > UPDATE old_reserves SET timestamp=ADDDATE(NOW(), INTERVAL -4 DAY); $ kshell k$ perl misc/cronjobs/batch_anonymise.pl --days 2 -v --- misc/cronjobs/batch_anonymise.pl | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) --- a/misc/cronjobs/batch_anonymise.pl +++ a/misc/cronjobs/batch_anonymise.pl @@ -17,15 +17,19 @@ # You should have received a copy of the GNU General Public License # along with Koha; if not, see . -use strict; -use warnings; +use Modern::Perl; use Koha::Script -cron; + use C4::Context; +use C4::Log qw( cronlogaction ); + +use Koha::Database; +use Koha::Old::Holds; use Koha::Patrons; + use Date::Calc qw( Add_Delta_Days Today ); use Getopt::Long qw( GetOptions ); -use C4::Log qw( cronlogaction ); sub usage { print STDERR <search_patrons_to_anonymise( { before => $formatdate } )->anonymise_issue_history( { before => $formatdate } ); $verbose and print int($rows) . " checkouts anonymised.\n"; +$rows = Koha::Old::Holds + ->filter_by_anonymizable + ->filter_by_last_update( { days => $days } ) + ->anonymize; + +$verbose and print int($rows) . " holds anonymised.\n"; + exit(0); --