I'm not sure if this is a bug or a problem in how I'm running the clean_database.pl script... Running the script, it says the sessions are going to be purged: $ PERL5LIB=$PERL5LIB $KOHA_CRON_PATH/cleanup_database.pl -v --sessions --sessdays 2 Session purge triggered with days>2. 0 sessions were deleted. Done with session purge with days>2. But there are sessions older than 2 days: mysql> select * from sessions; | 00000ea4915d23eff57160797fdd1d55 | --- _SESSION_ATIME: '1315496500' _SESSION_CTIME: '1315496500' _SESSION_ID: 00000ea4915d23eff57160797fdd1d55 ... and Unix time stamp '1315496500' translates to 'Thu, 08 Sep 2011 15:41:40 GMT'. Did I miss something?? Tom -- ----------------------------------------------------------------------------- Tom Hanstra Systems Administrator Hesburgh Libraries of Notre Dame Phone: (574)631-4686 213 Hesburgh Library Email: tom@nd.edu Notre Dame, IN 46556 Please stop, I'm bored. Miss Sweetie Poo -----------------------------------------------------------------------------
Include the --sessions parameter too. I agree with you that this should be improved. Will send a patch for that next week. ________________________________________ Van: koha-bounces@lists.katipo.co.nz [koha-bounces@lists.katipo.co.nz] namens Tom Hanstra [tom@nd.edu] Verzonden: donderdag 13 oktober 2011 21:46 Aan: Koha listserv Onderwerp: [Koha] cleanup_database.pl I'm not sure if this is a bug or a problem in how I'm running the clean_database.pl script... Running the script, it says the sessions are going to be purged: $ PERL5LIB=$PERL5LIB $KOHA_CRON_PATH/cleanup_database.pl -v --sessions --sessdays 2 Session purge triggered with days>2. 0 sessions were deleted. Done with session purge with days>2. But there are sessions older than 2 days: mysql> select * from sessions; | 00000ea4915d23eff57160797fdd1d55 | --- _SESSION_ATIME: '1315496500' _SESSION_CTIME: '1315496500' _SESSION_ID: 00000ea4915d23eff57160797fdd1d55 ... and Unix time stamp '1315496500' translates to 'Thu, 08 Sep 2011 15:41:40 GMT'. Did I miss something?? Tom -- ----------------------------------------------------------------------------- Tom Hanstra Systems Administrator Hesburgh Libraries of Notre Dame Phone: (574)631-4686 213 Hesburgh Library Email: tom@nd.edu Notre Dame, IN 46556 Please stop, I'm bored. Miss Sweetie Poo ----------------------------------------------------------------------------- _______________________________________________ Koha mailing list http://koha-community.org Koha@lists.katipo.co.nz http://lists.katipo.co.nz/mailman/listinfo/koha
On 14 October 2011 08:46, Tom Hanstra <tom@nd.edu> wrote:
I'm not sure if this is a bug or a problem in how I'm running the clean_database.pl script...
Running the script, it says the sessions are going to be purged:
$ PERL5LIB=$PERL5LIB $KOHA_CRON_PATH/cleanup_database.pl -v --sessions --sessdays 2 Session purge triggered with days>2. 0 sessions were deleted. Done with session purge with days>2.
But there are sessions older than 2 days:
mysql> select * from sessions; | 00000ea4915d23eff57160797fdd1d55 | --- _SESSION_ATIME: '1315496500' _SESSION_CTIME: '1315496500' _SESSION_ID: 00000ea4915d23eff57160797fdd1d55 ...
and Unix time stamp '1315496500' translates to 'Thu, 08 Sep 2011 15:41:40 GMT'.
Hmm nope that should have worked. One thing I would encourage you to do Tom, is to switch from using mysql for session storage, to using memcached. You will get a nice speed increase and not have to worry about purging the db table also. If you are on 3.4.0 or later you should have this option available. Back to your problem what is the rest of the session data is there a bit that says lasttime: ? Chris
Chris, I was wondering which date was used. Is it lasttime? In this case, it is the same time stamp: lasttime: '1315496500' I'll look into memcached. That might be a good option for us. Thanks, Tom On 10/13/2011 04:04 PM, Chris Cormack wrote:
On 14 October 2011 08:46, Tom Hanstra<tom@nd.edu> wrote:
I'm not sure if this is a bug or a problem in how I'm running the clean_database.pl script...
Running the script, it says the sessions are going to be purged:
$ PERL5LIB=$PERL5LIB $KOHA_CRON_PATH/cleanup_database.pl -v --sessions --sessdays 2 Session purge triggered with days>2. 0 sessions were deleted. Done with session purge with days>2.
But there are sessions older than 2 days:
mysql> select * from sessions; | 00000ea4915d23eff57160797fdd1d55 | --- _SESSION_ATIME: '1315496500' _SESSION_CTIME: '1315496500' _SESSION_ID: 00000ea4915d23eff57160797fdd1d55 ...
and Unix time stamp '1315496500' translates to 'Thu, 08 Sep 2011 15:41:40 GMT'.
Hmm nope that should have worked. One thing I would encourage you to do Tom, is to switch from using mysql for session storage, to using memcached. You will get a nice speed increase and not have to worry about purging the db table also.
If you are on 3.4.0 or later you should have this option available.
Back to your problem what is the rest of the session data is there a bit that says lasttime: ?
Chris
-- ----------------------------------------------------------------------------- Tom Hanstra Systems Administrator Hesburgh Libraries of Notre Dame Phone: (574)631-4686 213 Hesburgh Library Email: tom@nd.edu Notre Dame, IN 46556 Please stop, I'm bored. Miss Sweetie Poo -----------------------------------------------------------------------------
Hi all. As it happens I noticed a problem with this on Tom's system in the UK. The script looks for the date in the sessions table but needs to search for the quotes too. So as it comes it will not trap --sessdays. I have only just fixed that on the UK system in the cleanup_database.pl. Towards the end it should be: while ( $sth->fetch ) { $lasttime = 0; if ( $a_session =~ /lasttime:\s+'(\d+)/ ) { $lasttime = $1; } elsif ( $a_session =~ /(ATIME|CTIME):\s+'(\d+)/ ) { $lasttime = $2; } but was missing the single quote. I know it should go as a bug with a patch... Ian On 13/10/2011 21:04, Chris Cormack wrote:
On 14 October 2011 08:46, Tom Hanstra<tom@nd.edu> wrote:
I'm not sure if this is a bug or a problem in how I'm running the clean_database.pl script...
Running the script, it says the sessions are going to be purged:
$ PERL5LIB=$PERL5LIB $KOHA_CRON_PATH/cleanup_database.pl -v --sessions --sessdays 2 Session purge triggered with days>2. 0 sessions were deleted. Done with session purge with days>2.
But there are sessions older than 2 days:
mysql> select * from sessions; | 00000ea4915d23eff57160797fdd1d55 | --- _SESSION_ATIME: '1315496500' _SESSION_CTIME: '1315496500' _SESSION_ID: 00000ea4915d23eff57160797fdd1d55 ...
and Unix time stamp '1315496500' translates to 'Thu, 08 Sep 2011 15:41:40 GMT'.
Hmm nope that should have worked. One thing I would encourage you to do Tom, is to switch from using mysql for session storage, to using memcached. You will get a nice speed increase and not have to worry about purging the db table also.
If you are on 3.4.0 or later you should have this option available.
Back to your problem what is the rest of the session data is there a bit that says lasttime: ?
Chris _______________________________________________ Koha mailing list http://koha-community.org Koha@lists.katipo.co.nz http://lists.katipo.co.nz/mailman/listinfo/koha
-- Ian Bays Director of Projects PTFS Europe mobile: +44 (0) 7774995297 phone: +44 (0) 800 756 6803 skype: ian.bays email: ian.bays@ptfs-europe.com
Tom, The reason we came across the problem on your system is that the web-based self-check was being reset overnight and needed logging in every morning(somewhat defeating the purpose). We narrowed it down to just clearing the sessions without the sessdays parameter in the crontab overnight. We thought using the sessdays parameter would solve the problem but the sessions database crept up again. This knowledge might help others using the web-based self-check if their session needs logging in every day. Cheers. Ian On 13/10/2011 21:28, Ian Bays wrote:
Hi all. As it happens I noticed a problem with this on Tom's system in the UK. The script looks for the date in the sessions table but needs to search for the quotes too. So as it comes it will not trap --sessdays. I have only just fixed that on the UK system in the cleanup_database.pl. Towards the end it should be:
while ( $sth->fetch ) { $lasttime = 0; if ( $a_session =~ /lasttime:\s+'(\d+)/ ) { $lasttime = $1; } elsif ( $a_session =~ /(ATIME|CTIME):\s+'(\d+)/ ) { $lasttime = $2; } but was missing the single quote. I know it should go as a bug with a patch...
Ian
On 13/10/2011 21:04, Chris Cormack wrote:
On 14 October 2011 08:46, Tom Hanstra<tom@nd.edu> wrote:
I'm not sure if this is a bug or a problem in how I'm running the clean_database.pl script...
Running the script, it says the sessions are going to be purged:
$ PERL5LIB=$PERL5LIB $KOHA_CRON_PATH/cleanup_database.pl -v --sessions --sessdays 2 Session purge triggered with days>2. 0 sessions were deleted. Done with session purge with days>2.
But there are sessions older than 2 days:
mysql> select * from sessions; | 00000ea4915d23eff57160797fdd1d55 | --- _SESSION_ATIME: '1315496500' _SESSION_CTIME: '1315496500' _SESSION_ID: 00000ea4915d23eff57160797fdd1d55 ...
and Unix time stamp '1315496500' translates to 'Thu, 08 Sep 2011 15:41:40 GMT'.
Hmm nope that should have worked. One thing I would encourage you to do Tom, is to switch from using mysql for session storage, to using memcached. You will get a nice speed increase and not have to worry about purging the db table also.
If you are on 3.4.0 or later you should have this option available.
Back to your problem what is the rest of the session data is there a bit that says lasttime: ?
Chris _______________________________________________ Koha mailing list http://koha-community.org Koha@lists.katipo.co.nz http://lists.katipo.co.nz/mailman/listinfo/koha
-- Ian Bays Director of Projects PTFS Europe mobile: +44 (0) 7774995297 phone: +44 (0) 800 756 6803 skype: ian.bays email: ian.bays@ptfs-europe.com
participants (4)
-
Chris Cormack -
Ian Bays -
Marcel de Rooy -
Tom Hanstra