Skip to content

Instantly share code, notes, and snippets.

@ForestMars
Created October 18, 2012 14:23
Show Gist options
  • Select an option

  • Save ForestMars/3912175 to your computer and use it in GitHub Desktop.

Select an option

Save ForestMars/3912175 to your computer and use it in GitHub Desktop.
Pantheon Drupal files script
## Script to automatically pulldown all the files from any Pantheon environment to your local environment.
## To execute the script, copy the Pantheon download link onto your clipboard
#!/bin/bash
## Path to local developement environment is defined here:
declare siteroot=
echo "enter path to files tarball on s3"
read panfilepath
echo panfilepath
declare filepath=/sites/default
fileroot=$siteroot$filepath
cd $fileroot
echo "executing on the following directory:"
pwd
curl -O "$panfilepath"
echo "files obtained. inflating."
files=( files_dev* ); if (( ${#files[@]} > 0 )) ; then
echo "files exist";
tar zxvf files_dev.tar*
echo "tarball inflated, synching files"
cp -r files_dev/* files/
echo "cleaning up."
rm rf files_dev*
else echo "file not found"; fi
files=( files_test* ); if (( ${#files[@]} > 0 )) ; then
echo "files exist";
tar zxvf files_test.tar*
echo "tarball inflated, synching files"
cp -r files_test/* files/
echo "cleaning up."
rm -rf files_test*
else echo "file not found"; fi
files=( files_live* ); if (( ${#files[@]} > 0 )) ; then
echo "files exist";
tar zxvf files_live.tar*
echo "tarball inflated, synching files"
cp -r files_live/* files/
echo "cleaning up."
rm -rf files_test*
else echo "file not found"; fi
exit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment