Skip to content

Commit db9bb34

Browse files
committed
Add purge-sessions.sh
1 parent a0be860 commit db9bb34

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

purge-sessions.sh

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/usr/bin/env bash
2+
3+
# Run this in the background to purge the sessions
4+
# $ ./purge-sessions.sh &
5+
6+
# Log file
7+
LOG=log/purge.log
8+
9+
# Purge sessions every hour
10+
TIMEOUT=3600
11+
12+
while true
13+
do
14+
echo >> $LOG
15+
echo Purging sessions: `date -u` >> $LOG
16+
bundle exec rake sessions:purge 2&>1 >> $LOG
17+
18+
sleep $TIMEOUT
19+
done
20+

0 commit comments

Comments
 (0)