From a543f751b311a53e3bbdd92be0a7b0eb03116665 Mon Sep 17 00:00:00 2001 From: e20643 Date: Tue, 19 Sep 2023 10:34:33 +0200 Subject: [PATCH] feat: add script to manual archive data --- bec_plugins/utils/csaxs_post_archive.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/bec_plugins/utils/csaxs_post_archive.py b/bec_plugins/utils/csaxs_post_archive.py index 4d8e957..00a9b4b 100755 --- a/bec_plugins/utils/csaxs_post_archive.py +++ b/bec_plugins/utils/csaxs_post_archive.py @@ -125,8 +125,9 @@ class csaxs_archiver: command = f'datasetIngestor -allowexistingsource -ingest -autoarchive -noninteractive -token {self.token} {self.metadata_file} {self.datafile_name}' rtr = os.popen(command) - with open(os.path.join(fname,'_log.txt'), "w") as file: - file.write(rtr.read()) + #with open(os.path.join(fname,'_log.txt'), "w") as file: + # print(f'Writing reponse to file') + # file.write(rtr.read()) # result = subprocess.run(command, shell=False, stdout = subprocess.PIPE, stderr = subprocess.PIPE, universal_newlines=True) # if result.returncode == 0: # print(f"Command {command} was succesful") @@ -138,10 +139,10 @@ if __name__ == "__main__": # Generate dictionary with user input. user_input = { "base_path": "~/Data10", - "eacc": "e20639", + "eacc": "e20643", "pi": "Marianne Liebi", "pi_email": "marianne.liebi@psi.ch", 'log_path' : '~/Data10/documentation/ingestion_logs/' } - archiver = csaxs_archiver(start_scan=10, stop_scan=20, token='', **user_input) + archiver = csaxs_archiver(start_scan=1, stop_scan=349, token='csEwVQif0tuKZ11YtAMvGY0faEjv9JqxrBa9x3Z5E13oWXAMyaLxKtQrmzbemqj5', **user_input) archiver.run_for_all_scans()