Noam Meltzer writes:

So, I decided that I want to backup my data.
On first look, it seems very simple as I have only one user (me): All
I need to do is make one tarball of my Maildir, and that should do the
trick.
But then, another thought crossed my mind: If the imapd/webmail
daemons are running, maybe they access my files somehow?
I know that in databases, when you backup using raw mode, you want to
stop the database, make the backup, and then start the database again.
Does backing up the Maildir of courier is a similar scenario?

In general, no.

However there may be an operating-system dependent race condition, when a backup of a particular folder occurs at the same time as the message's status flags are changed, which is implemented by a single rename call. Depending on the operating system there might be an issue that when an application is reading the directory contents at the same time as the rename operation is in progress, the application will either: not see either the old filename nor the newfile; or see both; or see the old filename, but the rename operation gets processed immediately afterwards and the backup process's attempt to open the file will fail.

So there is an infinitessimally small chance that a live backup will screw up one or two messages, once in a blue moon. However that will only matter if it becomes necessary to recover the system; at which point you already have an entire server offline and nobody will care about one or two messages.

And if you do need reliable mail storage to such a degree, then you should probably be looking at redundant disk and network hardware anyway, instead of this.


Attachment: pgp00000.pgp
Description: PGP signature

Reply via email to