diff --git a/purge-sessions.sh b/purge-sessions.sh new file mode 100755 index 0000000..e93ddaa --- /dev/null +++ b/purge-sessions.sh @@ -0,0 +1,20 @@ +#!/usr/bin/env bash + +# Run this in the background to purge the sessions +# $ ./purge-sessions.sh & + +# Log file +LOG=log/purge.log + +# Purge sessions every hour +TIMEOUT=3600 + +while true +do + echo >> $LOG + echo Purging sessions: `date -u` >> $LOG + bundle exec rake sessions:purge 2&>1 >> $LOG + + sleep $TIMEOUT +done +