Got Your Back

Got Your Back is a command line tool for backing up your Gmail messages to your computer using Gmail's API over HTTPS.


gyb --email "${EMAIL}" --action create-project

Follow along:

  • - automated project creation
    • Provide verification code
  • Agree to Google Cloud Terms of Service... If you haven't already
  • Configure the application
  • Create the credentials ("OAuth Client ID"), and supply to gyb
  • Visit and revoke "GAM Project Creation" access
  • Configure the relevant access (I prefer backup only, uncheck all others)
    • gyb --email "${EMAIL}" --action estimate (you can cancel)
  • Authorize gyb access to backup emails only

Keep the following files safe:

  • client_secrets.json
  • ${EMAIL}.cfg


You might want to use --local-folder to direct the stored messages.

gyb --email "${EMAIL}" --action backup