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.

Setup

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

Follow along:

  • https://gyb-shortn.jaylee.us/xxxxxx - 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 https://myaccount.google.com/permissions 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

Backup

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

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