feat: add script to manual archive data

This commit is contained in:
e20643
2023-09-19 10:34:33 +02:00
parent 35b89ab86f
commit a543f751b3
+5 -4
View File
@@ -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()