diff options
author | Benjamin Kellermann <Benjamin.Kellermann@gmx.de> | 2016-04-15 00:07:10 +0200 |
---|---|---|
committer | Benjamin Kellermann <Benjamin.Kellermann@gmx.de> | 2016-04-15 00:07:10 +0200 |
commit | 352a10bf383c38c0b45bf0b66fec0bfd874ba08d (patch) | |
tree | b7283999e85379aadaca58e8a5cf4359fc662015 | |
parent | e9e848ee2d3ca27c11fd53dc092f46284f307119 (diff) |
add a cleanup cronjob which deletes old polls
-rw-r--r-- | README.md | 2 | ||||
-rw-r--r-- | dudle_cleanup.sh | 17 |
2 files changed, 19 insertions, 0 deletions
@@ -74,6 +74,8 @@ GNU AGPL v3 or higher (see file License) (You need an absolute path here!) 11. Try to open http://$YOUR_SERVER/check.cgi to check if your config seems to work. +12. You may want to install a cronjob to cleanup dudle polls. + See dudle_cleanup for an example. # Docker image There are two docker image available diff --git a/dudle_cleanup.sh b/dudle_cleanup.sh new file mode 100644 index 0000000..80620cb --- /dev/null +++ b/dudle_cleanup.sh @@ -0,0 +1,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 |