Created
June 6, 2019 18:29
-
-
Save bsmith89/f1e1678681fa825d5996eb822dd744d0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
remote='<PROJECT_PATH_HERE>' | |
for path in $@ | |
do | |
dirname=$(dirname $path) | |
basename=$(basename $path) | |
mkdir -p "$dirname" | |
# Use rsync --partial for restartable transfers. | |
partialdir=$TMPDIR/rsync-tmpdir/$remote/$dirname | |
mkdir -p "$partialdir" | |
rsync -hravz -P --partial-dir="$partialdir" <SERVER_NAME>:$remote/$path "$dirname" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Be sure to replace
<PROJECT_PATH_HERE>
and<SERVER_NAME>
with the path to your project directory on the remote server, and the name of the remote server, respectively.