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

Prepended some commands with nice at Ron Bosworth's request, to reduce CPU...

Prepended some commands with nice at Ron Bosworth's request, to reduce CPU impact on the synchrotron side.
parent e74b5130
No related branches found
No related tags found
No related merge requests found
...@@ -105,7 +105,7 @@ def send_directory(node, remote_login, src_path): ...@@ -105,7 +105,7 @@ def send_directory(node, remote_login, src_path):
# Check if there are any files in the node. # Check if there are any files in the node.
with Connection(remote_login) as c: with Connection(remote_login) as c:
files = c.run( files = c.run(
rf"cd {node.src}; find -maxdepth 1 -type f -printf '%f\n'", rf"cd {node.src}; nice find -maxdepth 1 -type f -printf '%f\n'",
echo=True echo=True
) )
files = files.stdout.strip() files = files.stdout.strip()
...@@ -135,7 +135,7 @@ def send_directory(node, remote_login, src_path): ...@@ -135,7 +135,7 @@ def send_directory(node, remote_login, src_path):
output = subprocess.run( output = subprocess.run(
f"ssh {remote_login} 'cd {node.src};" f"ssh {remote_login} 'cd {node.src};"
f"find -maxdepth 1 -type f -print0 |" f"nice find -maxdepth 1 -type f -print0 |"
f"cpio -o -H ustar -0' | cat > {node.dest}/{filename}.tar", f"cpio -o -H ustar -0' | cat > {node.dest}/{filename}.tar",
shell=True, shell=True,
check=True check=True
......
...@@ -102,7 +102,7 @@ def send_checksum(node, remote_login, src_path): ...@@ -102,7 +102,7 @@ def send_checksum(node, remote_login, src_path):
filename = node.src.replace(src_path+'/', '').replace('/', '_') filename = node.src.replace(src_path+'/', '').replace('/', '_')
output = subprocess.run( output = subprocess.run(
f"ssh {remote_login} 'cd {node.src}; md5sum *'" f"ssh {remote_login} 'cd {node.src}; nice md5sum *'"
f"| cat > {node.dest}/{filename}.md5", f"| cat > {node.dest}/{filename}.md5",
shell=True, shell=True,
check=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