Sessions table

Hi,
In the mysql.schema it says

"
# sessions is used by Apache::Session to keep sessions in the
database.

We should have a reaper script somewhere."

Does this “reaper script” exist anywhere, or has anyone written one. My
session table currently has 37276 rows in it, and it feels sensible to
purge it (although admittedly it doesn’t take up much room).

Thanks
John

John Green wrote:

Hi,
In the mysql.schema it says

"
# sessions is used by Apache::Session to keep sessions in the
database.

We should have a reaper script somewhere."

Does this “reaper script” exist anywhere, or has anyone written one. My
session table currently has 37276 rows in it, and it feels sensible to
purge it (although admittedly it doesn’t take up much room).

I have a feeling people just rewrite a reaper script whenever they need one.
Here’s mine:

#!/bin/sh
password="/bin/cat /root/mysql-root-password"
/usr/bin/mysql -p"$password"
-e ‘DELETE FROM sessions WHERE LastUpdated < NOW() - INTERVAL 1 DAY’ rt3