Skip to content

Commit

Permalink
Add purge-sessions.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
bqqbarbhg committed Mar 18, 2016
1 parent a0be860 commit db9bb34
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions purge-sessions.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit db9bb34

Please sign in to comment.