wok annotate zerobin/stuff/purge.sh @ rev 17744
Up zpaq (7.02)
author | necrophcodr <necrophcodr@necrophcodr.me> |
---|---|
date | Sat Mar 07 18:21:38 2015 +0000 (2015-03-07) |
parents | |
children | 5b0e64c0628a |
rev | line source |
---|---|
pascal@13153 | 1 #!/bin/sh |
pascal@13153 | 2 |
pascal@13153 | 3 cd $(dirname $0) |
pascal@13153 | 4 for i in ?? ; do |
pascal@13153 | 5 for j in $i/?? ; do |
pascal@13153 | 6 for k in $j/* ; do |
pascal@13153 | 7 [ -f $k ] || continue |
pascal@13153 | 8 grep -qs '"expire_date":' $k || continue |
pascal@13153 | 9 [ $(sed 's/.*"expire_date":\([0-9]*\).*/\1/' $k) -lt \ |
pascal@13153 | 10 $(date +%s) ] && rm -rf $k* |
pascal@13153 | 11 done |
pascal@13153 | 12 rmdir $j 2> /dev/null |
pascal@13153 | 13 done |
pascal@13153 | 14 rmdir $i 2> /dev/null |
pascal@13153 | 15 done |