From 06f8e1bfd4fd2a53b92a23ba83b985cd1d627125 Mon Sep 17 00:00:00 2001 From: John Marshall Date: Wed, 14 Aug 2024 14:15:11 +1200 Subject: [PATCH] Log a command to demo removing the outdated input files --- scripts/rename_embedded_ids.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scripts/rename_embedded_ids.py b/scripts/rename_embedded_ids.py index 11181c2ec..d86ae5eaf 100755 --- a/scripts/rename_embedded_ids.py +++ b/scripts/rename_embedded_ids.py @@ -52,9 +52,15 @@ def reheader_cram(old_url: str, old_id: str, new_id: str): if len(sys.argv) < 2: print(__doc__) + old_urls = [] for arg in sys.argv[1:]: field = arg.split(',') if len(field) >= 3: reheader_cram(field[0], field[1], field[2]) else: reheader_cram(field[0], 'CPG[0-9]*', field[1]) + old_urls.append(field[0]) + old_urls.append(f'{field[0]}.crai') + + logger.info(f'After checking the output, manually remove {len(old_urls)} outdated data files:') + logger.info(f'gcloud storage rm {" ".join(old_urls)}')