Loading transfer_service/cleaner.py +8 −6 Original line number Diff line number Diff line Loading @@ -47,10 +47,12 @@ for row in fileList: basePaths.append(basePath) for basePath in basePaths: for root, dir, files in os.walk(basePath, topdown = False): if root != basePath and not os.listdir(root): os.rmdir(root) print(datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S") + ' ' + root) for root, dirs, files in os.walk(basePath, topdown = False): for dir in dirs: dirPath = os.path.abspath(root) + '/' + dir if not os.listdir(dirPath): os.rmdir(dirPath) print(datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S") + ' ' + dirPath) # 1) delete files and update the db # 2) check for empty dirs and delete them if different from rootPath Loading
transfer_service/cleaner.py +8 −6 Original line number Diff line number Diff line Loading @@ -47,10 +47,12 @@ for row in fileList: basePaths.append(basePath) for basePath in basePaths: for root, dir, files in os.walk(basePath, topdown = False): if root != basePath and not os.listdir(root): os.rmdir(root) print(datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S") + ' ' + root) for root, dirs, files in os.walk(basePath, topdown = False): for dir in dirs: dirPath = os.path.abspath(root) + '/' + dir if not os.listdir(dirPath): os.rmdir(dirPath) print(datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S") + ' ' + dirPath) # 1) delete files and update the db # 2) check for empty dirs and delete them if different from rootPath