Nettoyage des sessions Vulture et compression de la base

En quelque ligne :

#!/bin/bash
SESSION=/var/www/vulture/sql/sessions
SQLITE=/bin/sqlite

# Nettoyage de la base
echo 'DELETE FROM sessions WHERE id IN (SELECT id FROM sessions LIMIT' `echo 'SELECT COUNT(*) - COUNT(*)*10/100 FROM sessions;' | $SQLITE $SESSION`');' | $SQLITE $SESSION

# Défragmentation et compression de la base
echo "VACUUM;" | $SQLITE $SESSION


comments powered by Disqus