Skip to content

Instantly share code, notes, and snippets.

@y-ogi
Created January 5, 2012 03:08
Show Gist options
  • Save y-ogi/1563524 to your computer and use it in GitHub Desktop.
Save y-ogi/1563524 to your computer and use it in GitHub Desktop.
bulkloader helper shell for GAE
#!/bin/bash
RETVAL=0
APPID=$2
KIND=$3
APPCFG_PY=/usr/local/bin/appcfg.py
download() {
echo "Downloading $KIND..."
$APPCFG_PY download_data --kind=$KIND --url=http://$APPID.appspot.com/remote_api --filename=bulkloader-dat.$KIND
RETVAL=0
}
upload() {
echo "Uploading $KIND..."
$APPCFG_PY upload_data --kind=$KIND --url=http://$APPID.appspot.com/remote_api --filename=bulkloader-dat.$KIND
RETVAL=0
}
usage() {
echo "Usage..."
echo "$0 (download|upload) [app-id] [kind]"
}
case $1 in
download)
download
;;
upload)
upload
;;
*)
usage
RETVAL=255
esac
exit $RETVAL
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment