Koha How-To
Cron Jobs: Batch Anonymize
Batch Anonymize
The cron in Koha that is called Batch Anonymize removes borrower numbers from circulation history so that the stats are kept, but the patron information is removed for privacy reasons.
For a library to anonymize patron data, a few things will need to be set up in Koha. Privacy is a big deal within libraries, and Koha has provided the ability to define what and who gets their information anonymized.
Set Up
First, there is a system preference called AnonymousPatron. This system preference needs to be filled out so the patron’s history is not stored at the specific patron level but instead is saved to an ‘anonymize patron’. If your library does not have a patron defined as the ‘anonymous patron’, you will want to create one and then add the borrower number of this patron into the system preference. If this system preference is not filled out, the cron will not run.
Next, your library will need to determine which patron categories will have their patron history anonymized. Within the patron category set up (found in Admin), a library can choose three different privacy settings.
Default: Default privacy means that the patrons in this category will be affected by this cron and the library will determine how long the / how often the cron (batch anonymize) will run.
Forever: If a library category was chosen to retain patron history, this can be set at Forever and the Batch Anonymize cron will ignore these patrons.
Never: The last option would be to set a patron category to Never, which would tell Koha to anonymize checkouts on return.
For the patron categories that are set to Default, the Batch Anonymize cron can be set up to run daily and will pick up patron history that is older than X number of days. The library can choose the number of days the patron history is kept prior to being removed from the system.
Cron Line
This is an example of the cron line run that would remove patron history (set to default in the patron category) after 5 days:
cronjobs/batch_anonymise.pl --days 5
#$KOHA_CRON_PATH/batch_anonymise.pl --days 365 > /dev/null
More Information
For more information about other crons available in Koha, see the Koha Manual.
Also, there are other Cron Related Blog Posts:
How Would You Like Your Report?
Automatically Delete Self-Registered Patrons
Read more by Kelly McElligott