diff --git a/purgeConfigGraphics.sh b/purgeConfigGraphics.sh index 2d7ccdd..97d3622 100755 --- a/purgeConfigGraphics.sh +++ b/purgeConfigGraphics.sh @@ -2,4 +2,4 @@ DIR=`dirname "$0"` # purge all .jpg files over 1 day old -find "$DIR/www/configs" -name "*.jpg" \! \( -newerct '1 day ago' \) -delete +find "$DIR/www/configs" -name "*.jpg" \! \( -newerct '1 hour ago' \) -delete diff --git a/purgePrivateConfigs.py b/purgePrivateConfigs.py index c240150..f1e22f4 100755 --- a/purgePrivateConfigs.py +++ b/purgePrivateConfigs.py @@ -25,11 +25,11 @@ def hasReplay(self, bindPath): replayPath = self.replayPath(bindPath) return replayPath.exists() - def isOverOneDayOld(self, bindPath): + def isOverOneHourOld(self, bindPath): stat = bindPath.stat() fileTouchedTime = stat.st_ctime now = time.time() - cutoff = now - 86400 # bad practice but good enough for this + cutoff = now - 3600 return fileTouchedTime < cutoff def thoseWithoutReplay(self, bindingsPaths): @@ -49,7 +49,7 @@ def purge(self): sys.exit('%s not found' % self.configsDir) allBindings = self.allBindings() privateBindings = self.thoseWithoutReplay(allBindings) - oldPrivateBindings = [path for path in privateBindings if self.isOverOneDayOld(path)] + oldPrivateBindings = [path for path in privateBindings if self.isOverOneHourOld(path)] deepListToPurge = [self.allFilesStartingWithStem(path) for path in oldPrivateBindings] filesToPurge = [x for sublist in deepListToPurge for x in sublist] for path in filesToPurge: