-
-
Save qdzlug/35a4ab66488b4e2af6ae to your computer and use it in GitHub Desktop.
This file contains 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
# Phase 1 Retrieves directories, creates hierarcy from current working directory. | |
mfind -t d ~~/stor/winfoo | sed "s,/$MANTA_USER/stor/,," | xargs -I {} mkdir -p "{}" | |
# This retrieves object paths, splits into download file and target local directory file | |
# Phase 2 retrieves objects, splits into source/target directories, calls mget | |
mfind -t o ~~/stor/winfoo | tee dnldfiles.txt | sed -e "s,/$MANTA_USER/stor/,," | xargs -I {} dirname "{}" > dnlddirs.txt | |
# the dnlddirs.txt file can be prepended with a target directory or windows-ified | |
cat dnldfiles.txt | xargs -I {} basename "{}" > dnldnames.txt | |
paste -d '/' dnlddirs.txt dnldnames.txt > targets.txt | |
paste -d '"' dnldfiles.txt targets.txt > dnldsets.txt | |
# put quotation marks at front and end of each line... stick in -o .. run mget | |
sed -e 's/\"/\" -o \"/g' -e 's/$/"/' -e 's/^/\"/' dnldsets.txt | xargs mget | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment