[wellylug] Backing up maildirs

Richard Hector rhector at paradise.net.nz
Sun Aug 24 20:08:12 NZST 2003


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.
> Can anyone recommend the easiest way to do this so that I have as few
> problems as possible.
> There are 4 email accounts with about 10Meg of data in total.

If both machines will be alive at the same time, I'd use rsync.

The invocation I remember, and therefore use most of the time, is:

rsync -avx /source/dir/ user at desthost:/dest/dir/

where -a is archive mode (preserve permissions, times etc, and implies
various other things like recursive to descend the tree), -v is verbose
and -x is stay within a filesystem. If you are the same user on both, you
can dispense with 'user@'. Leave the slashes on the end; I can't remember
exactly what happens if you don't, but it's never what I want (it will
probably create a new dir with the old name under the new dir, if that
makes any sense ...).

If both are on the same machine (eg you've mounted your new disk under
/mnt or something), you can still use rsync without the 'user at desthost:'
bit.

This is actually how I've mostly been using it recently - after
creating new filesystems with LVM after installing without (the current
Debian installer doesn't support LVM), I mount the new fs under /mnt.
eg (in single user mode):

mount /dev/system/vol-home /mnt
rsync -avx /home/ /mnt/
umount /mnt
rm -rf /home/
mount /dev/system/vol-home /home

HTH,

Richard




More information about the wellylug mailing list