gyb: backup & restore Gmail

gmail_compGmail is the most widely used email service today. Wouldn’t it be great if you could backup your emails locally and restore them whenever you needed from the cmdline? got-your-back (gyb) is a Python3 utility that can do it for you. gyb uses a secure connection (HTTPS) to talk to Gmail APIs.


  • Gmail backup and restore
  • Selective backup with search results
  • Mutiple permissive modes (only backup or only restore)
  • Gmail full access (including message purge)
  • Manipulate labels
  • Google Apps groups restore
  • Check Gmail quota
  • Works on Linux, Windows and Mac


To install gyb on Ubuntu, run:

$ sudo apt-get install python3-openssl python3-cffi
$ git clone
$ cd got-your-back
$ chmod +x


To check the full help, run:

$ ./ --help

To initiate a connection:

$ ./ --email --action estimate

Perform a backup:

$ ./ --email --action backup --local-folder destination_dir

Restore a backup to another gmail account:

$ ./ --email --action restore --local-folder source_dir

Selectively backup mails matching search criteria:

$ ./ --email --search "is:important OR is:starred"


Features: 4.5/5
Usability: 4/5

On GitHub: gyb


Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s