Skip to content

Instantly share code, notes, and snippets.

@Atrix1987
Last active February 9, 2017 09:06
Show Gist options
  • Save Atrix1987/6063050cef0a332281e7396c5995ed38 to your computer and use it in GitHub Desktop.
Save Atrix1987/6063050cef0a332281e7396c5995ed38 to your computer and use it in GitHub Desktop.
Full script for downloading from Amplitude and uploading to Google Cloud Storage
#Get data
curl -u 649cxxx9663axxxx6042559e3:10yyy0c67zzz0 'https://amplitude.com/api/2/export?start=20161018T0&end=20161018T23' >> 20161018.zip
#Unzip The file
unzip 20161018.zip -d 20161018
#Remove folder nesting where 123456 is amplitude app id
mv 20161018/123456/*.gz 20161018
#Removing folders to maintain a decent structure
rmdir 20161018/123456
#Upload to GCS
gsutil -m cp -r 20161018 gs://BUCKET-NAME/sources/amplitude_/events/20161018
#Cleaning up
rm -rf 20161018
rm 20161018.zip
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment