Skip to content

Instantly share code, notes, and snippets.

@nsfmc
Created September 26, 2013 21:30
Show Gist options
  • Save nsfmc/6720866 to your computer and use it in GitHub Desktop.
Save nsfmc/6720866 to your computer and use it in GitHub Desktop.
saves my old appengine datastore and replaces it with a new one
function upgrade_datastore () {
local ds_source="${HOME}/Dropbox/Khan Academy All Staff/Other shared items/datastores"
local ds_target="${HOME}/projects/.gae"
local backup_name="current.sqlite $(date "+%Y-%m-%d %H.%M.%S")"
mv "${ds_target}/current.sqlite" "${ds_target}/${backup_name}"
cp "${ds_source}/current.sqlite" "${ds_target}/"
echo "Copied new current.sqlite from dropbox"
echo "Your old current.sqlite has been archived at "
echo " ${fg[yellow]}${ds_target}/${backup_name}"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment