gyb
command-line tool for backing up and restoring Gmail
TLDR
Backup Gmail
$ gyb --email [user@gmail.com] --action backup
Restore emails$ gyb --email [user@gmail.com] --action restore
Estimate backup size$ gyb --email [user@gmail.com] --action estimate
Backup specific label$ gyb --email [user@gmail.com] --action backup --label-group [label]
Count messages$ gyb --email [user@gmail.com] --action count
SYNOPSIS
gyb [options]
DESCRIPTION
GYB (Got Your Back) is a command-line tool for backing up and restoring Gmail. It downloads emails as standard mbox format.
The tool uses Gmail API for reliable access. It supports incremental backups, label filtering, and search queries to select specific messages.
PARAMETERS
--email ADDR
Gmail address.--action ACT
Action: backup, restore, estimate, count.--local-folder DIR
Local backup directory.--label-group LABEL
Specific label to backup.--search QUERY
Gmail search query.--service-account
Use service account.--help
Display help information.
CAVEATS
Requires OAuth authorization. Rate limited by Gmail API. Large mailboxes take time.
HISTORY
GYB was created by Jay Lee as an open-source Gmail backup tool, widely used for Google Workspace migrations.
SEE ALSO
offlineimap(1), mbsync(1), mutt(1)
