Univention Bugzilla – Bug 53048
ucsschool-id-connector trash-directory is never cleaned up by the app
Last modified: 2023-06-30 13:23:39 CEST
The folder /var/lib/univention-appcenter/apps/ucsschool-id-connector/data/listener/trash/ consumed 12.2GB within 6 months of usage. I suggest a way to set an automatic removal of those json-Files in a logrotate-ish way.
another customer, running the connector for 3 weeks with <10% of the final user-base has 50k files in the trash directory, using 200 MB disk space. Do we really need to keep obviously processed items by default?
The idea was, that the user will remove those in a cronjob, but has the chance to make a backup. If you have a working solution using logrotate or a cronjob, please append a patch here. I'd be happy to integrate it into the app.
I suggest to create a cronjob in the join script. Please feel free to create a merge request for this file: https://git.knut.univention.de/univention/components/ucsschool-id-connector/-/blob/master/appcenter_scripts/inst
Fixed and merged. Version: 2.2.6 Commit: 2d2b6179e1e8cac884c7c7330a9ce9ac98e47598 Defaults: trash_delete_state = 1 (on) trash_delete_offset = 30 (days) To test manually: 0) Adapt variables (optional) 1) Create a file in the trash folder, which is older than the specified number of days with: touch -a -m -t <date> "/var/lib/univention-appcenter/apps/ucsschool-id-connector/data/listener/trash/test.json" 2) Run "python3 /etc/periodic/daily/listener_trash_cleaner" If the created file was older than the specified number of days, it will be deleted from /var/lib/univention-appcenter/apps/ucsschool-id-connector/data/listener/trash/"
The bugfix has been reviewed on the linked merge request. - [x] code ok - [x] tests were written - [x] jenkins very happy - [x] pipelines green - [x] docu: ok
Updates for UCS@school ID Connector 2.2.6 have been released. https://docs.software-univention.de/ucsschool-id-connector/HISTORY.html If this error occurs again, please clone this bug.