Skip to content

Commit

Permalink
add clean old logs script
Browse files Browse the repository at this point in the history
  • Loading branch information
OriHoch committed Jan 19, 2025
1 parent 67e9b11 commit 0a10832
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions hasadna_k8s/storage/cleanup_old_logs.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@ def delete_old_files(root_path, cutoff_date, dry_run=True):
else:
os.remove(file_path)
if not os.listdir(root) and root != root_path:
print(f'rmtree: {root}')
shutil.rmtree(root)
if dry_run:
print(f'rmtree: {root}')
else:
shutil.rmtree(root)


def find_log_paths(root_path, log_path_prefixes):
Expand Down

0 comments on commit 0a10832

Please sign in to comment.