#!/bin/sh -e
#
# $Cambridge: hermes/src/prayer/utils/prayer-db-prune,v 1.3 2008/09/16 10:00:08 dpc22 Exp $
#
# Script to clear out obsolete Berkeley DB tranaction log files from the
# Prayer SSL session cache. Based on work and research by Mike Brudenell
# <pmb1@york.ac.uk>

DB_BIN=/opt/db4/bin
SSL_CACHE=/var/spool/prayer/ssl_scache
PATH=${DB_BIN}:$PATH

cd ${SSL_CACHE}

db_checkpoint -h ${SSL_CACHE} -1

for i in `db_archive -h ${SSL_CACHE} -a`
do
  rm $i
done
