# HG changeset patch # User Marcin Kuzminski # Date 2012-10-25 22:25:21 # Node ID c400f2fbf1310bc5b991dbde27ce59236b674700 # Parent 08f89c688592414566b4311da195a8953a767822 cleanup script walks recursive on dirs to find repos to cleanup 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()