I set up an automatic archiver for gmail, using the special-purpose tool gm-vault. It was fairly straightforward, no tutorial here. The daily sync:
@daily cd ~gmail && cronic gmvault sync -d "/email@example.com" firstname.lastname@example.org
I’m specifying a backup folder here (-d) so I can easily support multiple accounts, one per line.
Cronic is a tool designed to make cron’s default email behavior better, so I get emailed only on actual backup failures.