Live data from Hacker News

Incremental Backups of Gmail Takeouts

baecher.dev

31–40 of 64 posts

Re: Incremental Backups of Gmail Takeouts

#33

Serious question: have you ever needed an email from even 5 years ago? I only save financial statements and contact information. Everything else gets deleted as soon as possible.

I routinely use it to look what a given product I bought and paid for, and by extension how old it is.

Also to reminisce how cheap stuff was.

So, yes

Re: Incremental Backups of Gmail Takeouts

#34
I have the same requirement and I solved it as follows:

Apply a label to emails dated after the last backup, using an “after:YYYY-MM-DD” search. Takeout then offers the option to export only that label. I do an annual backup so the amount of manual effort here is acceptable.

Re: Incremental Backups of Gmail Takeouts

#36
That imprecise chunking (with MD5 sums, and distributed across an FS tree, and using hash IDs, then separately storing the assembly information) seems like it would be a headache to restore, or to use with other mail programs.

An alternative idea is to properly parse it and store in smaller mbox files, such as one file month, with the idea that any month in the past usually will not change. (And if it changes because they are storing frequently changing attributes in a faux header, like an atime, then maybe strip that header.) Then your incremental `restic` backups work fine, and you can also use it easily with a variety of mail programs (MUAs, impromptu IMAP servers for migration, quick text editor, etc.).

Re: Incremental Backups of Gmail Takeouts

#37

What about using the Gmail API and listening for recent changes? I suppose it wouldn't be in a mailbox format that could be easily exported to another provider, though?

This is what I do! The API itself is not particularly amazing (the way it handles batch requests as a MIME multipart formatted POST body where each part is itself a HTTP request is particularly obscene).

The underlying data model is kind of OK though: messages are immutable, they get a long lived unique ID that survives changes to labels, etc. There is a history of changes you can grab incrementally. You can download the full message body that you can then parse as mail, and I save each one into a separate file and then index them in SQLite.

Re: Incremental Backups of Gmail Takeouts

#38

Serious question: have you ever needed an email from even 5 years ago? I only save financial statements and contact information. Everything else gets deleted as soon as possible.

I routinely use it to look what a given product I bought and paid for, and by extension how old it is. Also to reminisce how cheap stuff was. So, yes

Unfortunately, many ecommerce sites have nerfed their receipt emails to make this information harder for you to find.

Re: Incremental Backups of Gmail Takeouts

#40
I realized my inbox takes a lot of memory, even after a manual cleanup, it was still taking 5GB, despite regularly removing automated things and others.

I tried using takeout to have a more accurate listing. I thought I could open it with thunderbird, I failed, I then tried to open it with some python lib, also failed.

Post reply on HN