Add missing fasdb cleanup sessions cron job.

This commit is contained in:
Kevin Fenzi 2015-04-27 16:24:27 +00:00
parent 66b8df00ac
commit 28b402ded1
3 changed files with 36 additions and 0 deletions

View file

@ -0,0 +1,12 @@
#!/bin/sh
PGOPTIONS='-c maintenance_work_mem=1048576'
SESSIONDBS='fas2'
# Clean out old sessions since TurboGears doesn't
for db in $SESSIONDBS; do
/usr/bin/psql $db > /dev/null <<EOF
delete from visit where expiry < now() - interval '1h';
delete from visit_identity where visit_key not in (select visit_key from visit);
EOF
done