Skip to content

Instantly share code, notes, and snippets.

@WillForan
Last active July 6, 2017 17:37
Show Gist options
  • Save WillForan/4f2c5096b87398d2b18ea75027f87d0c to your computer and use it in GitHub Desktop.
Save WillForan/4f2c5096b87398d2b18ea75027f87d0c to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
# where to transfer folders
locOnGinger=/path/to/new/Siegle/
# make sure we can save logs
[ ! -d rsynclog] && mkdir rsynclog
# get dirs to tx from google doc, only grab those less than 300Gb
curl 'https://docs.google.com/spreadsheets/d/1wfXnWH7zI6H79u6o3fYV59iPBhG-JyaGhys7O9zmDCE/pub?output=tsv'|
awk '($3< 300000){print $2}' |
while read txdir; do
# do not want a trailing slash on the directory!
txdirnoslash=$(basename $txdir)
# rsync command. remove --dry-run to actually transfer
rsync -arLvhi --size-only --inplace --dry-run --progress \
wallace.wpic.upmc.edu:/data/Siegle/$txdirnoslash \
$locOnGinger |
tee rsynclog/$txdirnoslash.log
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment