Skip to content
Snippets Groups Projects
Commit e74b5130 authored by Gary Ruben (Monash University)'s avatar Gary Ruben (Monash University)
Browse files

fixed md5sum line to stop it breaking on lines with special characters

parent 795ab35e
No related branches found
No related tags found
No related merge requests found
......@@ -63,20 +63,6 @@ class Logger(object):
self.log.flush()
# READ_PICKLE_FILE = False
# EXPERIMENT_NAME = "13660a"
# PICKLE_FILENAME = os.path.join(os.path.dirname(__file__), "md5_state.pickle")
# timestamp = time.strftime("%Y-%m-%d-%H%M%S")
# LOG_FILENAME = os.path.join(
# os.path.dirname(__file__),
# f"md5-{EXPERIMENT_NAME}-{timestamp}.log"
# )
# REMOTE_LOGIN = "gary.ruben@monash.edu@sftp2.synchrotron.org.au"
# SRC_PATH = f"/data/{EXPERIMENT_NAME}/asci/output"
# DEST_PATH = "/home/grub0002/bapcxi/vault/IMBL_2018_Oct_McGillick/output"
def send_checksum(node, remote_login, src_path):
"""Checksums all files in the node.src directory and sends these to the
node.dest directory across an ssh connection. The checksum file is named
......@@ -116,8 +102,7 @@ def send_checksum(node, remote_login, src_path):
filename = node.src.replace(src_path+'/', '').replace('/', '_')
output = subprocess.run(
f"ssh {remote_login} 'cd {node.src};"
"md5sum $(find -maxdepth 1 -type f | cut -c3-)'"
f"ssh {remote_login} 'cd {node.src}; md5sum *'"
f"| cat > {node.dest}/{filename}.md5",
shell=True,
check=True
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment