[Bug 42491] New: Debian daily cronjob with cleanup_database.pl should only delete old sessions
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42491 Bug ID: 42491 Summary: Debian daily cronjob with cleanup_database.pl should only delete old sessions Initiative type: --- Sponsorship --- status: Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Architecture, internals, and plumbing Assignee: koha-bugs@lists.koha-community.org Reporter: dcook@prosentient.com.au QA Contact: testopia@bugs.koha-community.org In the Debian packages there is a daily cronjob that runs cleanup_database.pl with the --sessions option, which deletes ALL sessions. Typically, the daily cronjob is scheduled to run early in the morning, but it's still a pain for early users of Koha to lose their session due to this cronjob. By default, we should be adding at least --sessdays 1 to the cronjob, so that only sessions that haven't been used for 1 day or were created 1 day ago are cleaned up. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42491 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |dcook@prosentient.com.au |ity.org | -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42491 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42491 --- Comment #1 from David Cook <dcook@prosentient.com.au> --- Created attachment 198326 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=198326&action=edit Bug 42491: Change default daily cleanup to only delete old sessions This change makes the daily cronjob included in Debian packages only delete sessions that are older than 1 day. This prevents sessions from being disrupted if they are in use at the same time the daily cronjob is run. Test plan: 0. Apply the patch 1. Review the debian/koha-common.cron.daily file 2. Run the following SQL to check if you have any old sessions SELECT SUBSTRING_INDEX(SUBSTRING(a_session, LOCATE('_SESSION_ATIME:', a_session) + 15),'\n',1) AS lasttime FROM sessions HAVING lasttime < (UNIX_TIMESTAMP() - 86400); 3. If you do, run the following by hand: sudo koha-foreach --chdir --enabled \ /usr/share/koha/bin/cronjobs/cleanup_database.pl \ --confirm --sessions --sessdays 1 4. Re-run the SQL and note it now returns nothing but if you check "select * from sessions", you wil see that you still have (newer) sessions there. -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org