[wellylug] Backing up maildirs

Ewen McNeill wellylug at ewen.mcneill.gen.nz
Sun Aug 24 20:17:28 NZST 2003


In message <20030824080812.GB15558 at fake>, Richard Hector writes:
>On Sun, Aug 24, 2003 at 03:13:11PM +1200, Jamie Dobbs wrote:
>> I am in the process of replacing one PC with another and need to backup the
>> maildirs on the old PC to place them on the new hardware. [...]
>
>The invocation I remember, and therefore use most of the time, is:
>rsync -avx /source/dir/ user at desthost:/dest/dir/

If by "maildirs" you mean the qmail, etc, style one-file-per-message
directories, then beware that at least some programs assume that the file
name is (in part anyway) made up from the _inode_ number.  

And rsync doesn't preserve this relationship between filename and inode
numbers.  (Moving the directory on the same partition does, providing
it really is moving not copying and really is the same partition.)

If it were me, I'd be inclined to convert the maildir to mbox, copy the
mbox files over, and convert it back to maildir.  It'll be slower, but
assuming that the maildir -> mbox and mbox -> maildir tools are written
right, it'll be safer too.   (Not sure what to suggest for maildir ->
mbox and mbox -> maildir; I normally use either MH or mbox for my mail,
mostly MH.)

Ewen



More information about the wellylug mailing list