diff --git a/rhodecode/lib/cleanup.py b/rhodecode/lib/cleanup.py --- a/rhodecode/lib/cleanup.py +++ b/rhodecode/lib/cleanup.py @@ -88,9 +88,10 @@ class CleanupCommand(BasePasterCommand): repos_location = RhodeCodeUi.get_repos_location() to_remove = [] - for loc in os.listdir(repos_location): - if REMOVED_REPO_PAT.match(loc): - to_remove.append([loc, self._extract_date(loc)]) + for dn, dirs, f in os.walk(str(repos_location)): + for loc in dirs: + if REMOVED_REPO_PAT.match(loc): + to_remove.append([loc, self._extract_date(loc)]) #filter older than (if present)! now = datetime.datetime.now()