Skip to content

Instantly share code, notes, and snippets.

@cwvhogue
Last active December 24, 2015 02:29
Show Gist options
  • Select an option

  • Save cwvhogue/6731498 to your computer and use it in GitHub Desktop.

Select an option

Save cwvhogue/6731498 to your computer and use it in GitHub Desktop.
Script to populate a Manta Account with demo Getty Open images
#!/bin/bash
SITE="https://us-east.manta.joyent.com/mantademo/public/images/getty-open"
DEST="/$MANTA_USER/public"
echo Copy Demo JPEG files to your Manta Account as a tar file ...
mjob create -w -r "curl -ksL ${SITE}/demojpgs.tar | mput ${DEST}/demojpgs.tar" < /dev/null
echo Using muntar to extract the JPEG files on Manta ...
echo ${DEST}/demojpgs.tar | mjob create -o -m 'muntar -f $MANTA_INPUT_FILE /$MANTA_USER/public'
echo Downloading the JPEG files to your Local Machine into current directory `pwd` ...
curl -k ${SITE}/demojpgs.tar -o demojpgs.tar
tar -xvf demojpgs.tar
echo Removing the tar files ...
mrm ${DEST}/demojpgs.tar
rm demojpgs.tar
echo `mls ${DEST}/getty | wc -l` files extracted on Manta
echo `pwd`/getty is the location of the local copy of the JPEG images.
echo done.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment