aboutsummaryrefslogtreecommitdiff
path: root/dudle_cleanup.sh
blob: 80620cbb790b07c32c6890c5d6145358608d064d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/sh

DAYS=90

# installation path
DUDLE_DIR=/var/www/dudle/

for i in `find $DUDLE_DIR -maxdepth 2 -name last_read_access -mtime +$DAYS`;do
	echo "[`date --rfc-3339=seconds`] `ls -l $i`"
	rm -rf "`dirname "$i"`"
done

# clean up manually deleted polls
for i in `find /tmp/ -maxdepth 2 -name last_read_access -mtime +$DAYS`;do
	echo "[`date --rfc-3339=seconds`] `ls -l $i`"
	rm -rf "`dirname "$i"`"
done