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 "/home/gmail/vanceza@gmail.com" vanceza@gmail.com
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.