Skip to content

Instantly share code, notes, and snippets.

@gartenfeld
Last active September 29, 2023 23:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gartenfeld/aa720435f11a59eb1ebf39cf533203eb to your computer and use it in GitHub Desktop.
Save gartenfeld/aa720435f11a59eb1ebf39cf533203eb to your computer and use it in GitHub Desktop.
Downloading section JSON data
# First, set up ssh for Puhti
# Use ssh-copy-id to add your key
ssh-copy-id yourcscusername@puhti.csc.fi
# This way, you don't have to type your password for every command
# Make a .txt file with one file name (relative) per line
# Copy this file to remote
scp ./download_list.txt yourcscusername@puhti.csc.fi:.
# Log in
ssh yourcscusername@puhti.csc.fi
# Copy JSON data files from remote to remote
# Where {} is the placeholder to be replaced
# Run this from SSH terminal
cat download_list.txt | xargs -I {} scp yourcscusername@puhti.csc.fi:/scratch/project_number/relative/path/{} ./relative/path/
# Still on remote, make a dir
mkdir your_remote_dir
# Zip it up
zip -r zip_filename.zip relative/path
# This may take a while
# Back in local terminal, download the zip file
scp dyourcscusername@puhti.csc.fi:/users/yourusername/path_to_zip_filename.zip .
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment