From 2e7a2e995b94f008b9b8fc4bc20918ed78d57135 Mon Sep 17 00:00:00 2001 From: "Michael Pilosov, PhD" Date: Mon, 4 Mar 2024 22:11:15 +0000 Subject: [PATCH] copy script --- scripts/grab.sh | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 scripts/grab.sh diff --git a/scripts/grab.sh b/scripts/grab.sh new file mode 100644 index 0000000..ecedda7 --- /dev/null +++ b/scripts/grab.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +# Define the function to run the scp command for a specific value of j +run_scp() { + # studio id + id=$1 + # version number + j=$2 + + # job prefix + job=hour-colors-20240303-${j} + # name of file (locally) + out=hour-a${j}.mp4 + # name of file (remotely) + input=colors/lightning_logs/version_0/a0.mp4 + scp ${id}@ssh.lightning.ai:/teamspace/jobs/${job}/work/${input} ${out} +} + +# Export the function so that it can be used by parallel +export -f run_scp + +# Run scp command in parallel with 2 threads for j in 1 and 2 +parallel -j 2 run_scp ::: {1..3}