mail-crypt long-term support? How to backup?
I have a similar setup to you. Mail_crypt enabled, user-keys. Like Aki says, its best to use tar for this. I wrote a script a year or so back to incrementally backup my mailboxes. Curious what others think.
https://gitlab.com/ben.burk/burk.tech_personal/-/raw/master/maildirincbackup...
On 7/30/23 00:29, eaerhaerhaehae aehraerhaeha wrote:
I use a sliding window of time to determine what to backup, so maildir fs and database changes don't matter to me. Files can move, be deleted, whatever. Doesn't matter.
I can't use tar's incremental backups because mail has the potential to move around. That and the basename of the file has the potential to change, i.e. dovecot flags S=, etc. Its not particularly fast, as it maintains a dictionary of file: {md5sum, mtime} objects. I use find to prepare a preliminary list of what to backup depending on that aforementioned sliding window of time. I then md5 those files and compare data to determine if files moved, were deleted, etc. Then i remaster the dictionary. A bit more to it than that but that's the gist.
I have a tiny vps this runs on. Usually takes around 20-30 mins to process my monthly incrementals. Not an issue for me as the load induced is very low.
On 8/4/23 13:55, eaerhaerhaehae aehraerhaeha wrote:
Its more like shoveling a growing sand pile into a bucket. The incremental sliding window works by grabbing a time window between the last time the script stopped and when the current run started. After running, I overwrite the stopped time with the start time for the current run. These live as dotfiles. One can ascertain runtime of the script by looking at the mtime differences between the stop and start file. At the end of a run, the contents of those files should be the same datetime.
In this way I apportion changes that happen during the execution of the script to the next run.
The desired use case here is creating offsite incremental backups. I have healthcheck methods in this script as well that run on the offsite system that perform verification of incremental data before deltas are applied and verification of entire mailbox tree fs against the remastered timeline file after. It works very well in my use. I haven't had a single error or mismatch in over a year.
My use case is to make incremental backups monthly. My instance is small so I'd say the incrementals are around 100MiB monthly. Could probably cut each runtime and size down significantly if run more frequently.
I wrote all this before hearing about maildirlock. I may read about that and incorporate that as part of my solution possibly.
Ben Burk BURK.TECH System Administrator
Aug 5, 2023 6:53:34 AM eaerhaerhaehae aehraerhaeha <dovecotquestion@gmx.de>:
participants (3)
-
Aki Tuomi
-
Ben Burk
-
eaerhaerhaehae aehraerhaeha