After a few cron jobs related to authority records (misc/migration_tools/remove_unused_authorities.pl, misc/link_bibs_to_authorities.pl) were set up to run on our instance, I went to check the Log Viewer tool but couldn't tell that they were configured. I was told that only newer cron jobs actually appear in the logs, and on inspecting those two I saw that they lacked the call to `cronlogaction()` which our circulation-related cronjobs have. It'd be helpful to know if/when these jobs ran. I realize this is a bit debatable because those two scripts don't reside in misc/cronjobs and right now the only scripts that call `cronlogaction()` are in that directory. Is it appropriate to add that logging to these scripts? We do run them on a schedule, it's important to our authority records workflow. This is the complete list of ones I'd like to add logging to: - misc/link_bibs_to_authorities.pl - misc/cronjobs/merge_authorities.pl - misc/migration_tools/remove_unused_authorities.pl A side note: there are several scripts in misc/cronjobs, like merge_authorities.pl, that are not logged and probably should be, but that is a larger bug and I'd like to focus on these first since they're relevant to us.
Created attachment 126242 [details] [review] Bug 29238 - Cataloging cron jobs are not logged Here's an example patch. Is misc/migration_tools/remove_unused_authorities.pl maybe broken on master? Perl complained that DelAuthority() on line 102 was undefined, so I changed the "use" statement. But otherwise, the patch just adds a cronlogaction import and call when the script is run. Generally, `cronlogaction()` is called during dry runs like `remove_unused_authorities.pl --test` but not if the script is printing its usage information (e.g. `remove_unused_authorities.pl --help`). It'd be much more complicated to only log when data actually changes. Testing plan: 1. set CronjobLog to "Log" 2. Run the three cron jobs `perl misc/link_bibs_to_authorities.pl; perl misc/cronjobs/merge_authorities.pl -b; perl misc/migration_tools/remove_unused_authorities.pl --confirm` 3. Visit the log viewer /cgi-bin/koha/tools/viewlog.pl, select the "Cron jobs" module, & note it's empty 4. apply the patch 5. Repeat steps 2 & 3 but note the cron logs aren't empty
Created attachment 126243 [details] Screenshot of the logs
We'd appreciate this tiny enhancement. I thought our linker cron wasn't running today because it wasn't in the log. Can we bump this up? Thanks!
Eric, should this be at needs signoff?
Yes, sorry, I'm not super familiar with Bugzilla.
The patch doesn't apply anymore. There seems to be a couple of conflicts. Error while trying to run git bz apply 29238: Using index info to reconstruct a base tree... M misc/link_bibs_to_authorities.pl M misc/migration_tools/remove_unused_authorities.pl Falling back to patching base and 3-way merge... Auto-merging misc/migration_tools/remove_unused_authorities.pl CONFLICT (content): Merge conflict in misc/migration_tools/remove_unused_authorities.pl Auto-merging misc/link_bibs_to_authorities.pl CONFLICT (content): Merge conflict in misc/link_bibs_to_authorities.pl error: Failed to merge in the changes. Patch failed at 0001 Bug 29238 - Cataloging cron jobs are not logged
Created attachment 172240 [details] [review] Bug 29238 - Cataloging cron jobs are not logged Updated patch based off master. The files were just touched in between, this patch doesn't do anything different. Weird that git merge wouldn't have been able to work through it.