Skip to content

Instantly share code, notes, and snippets.

@pzelasko
Last active May 19, 2023 02:55
Show Gist options
  • Save pzelasko/76eaa20f8108722b13d654b665a5ac63 to your computer and use it in GitHub Desktop.
Save pzelasko/76eaa20f8108722b13d654b665a5ac63 to your computer and use it in GitHub Desktop.
Parallel rsync for downloading a directory from remote server
#!/bin/bash
host="$1"
source_dir="$2"
target_dir="$3"
ssh "$host" ls "$source_dir" | parallel -j8 -v --sshdelay 0.2 rsync -raz --progress "$host":"$source_dir"/{} "$target_dir"/{}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment