1

I have an email server and I want to backup everything under /var/spool/mail/ and als the email boxes in the user homes.

Using tar when archiving the mail results in the following:

tar: var/spool/mail/server: file changed as we read it
tar: Error exit delayed from previous errors

Is there any better way to backup mail without temporary stopping the email server?

3 Answers 3

2

If your server uses LVM then you can create a snapshot of the filesystem containing the spool. You then can mount the snapshot somewhere and tar the directory on the snapshot. This wil ensure that the mail directory that you want to archive doesn't change anymore while the live server will continue to process mails.

1

This is a common problem. Common answer is to use tar nevertheless. Bigger boys use transactional filesystems which support snapshots and making backups of snapshots.

Another shot is to make a copy of the backup ( with hardlinks if possible ) and then use rsync to update the copy. This will minimize the transfers and lessens the damage.

0

tar is not designed for efficient and reliable error free backups. It is better to use some backup utility to accomplish this task. i would personally recommend bacula for this task, as through it, you can automate backups at any schedule. Set backups once, and forget.

2
  • 2
    Forget? FORGET? Backups are not to be forgotten, one needs to test restore possibilities regularly. Backing up is easy, restoring is the tricky part. Nov 8, 2011 at 8:50
  • Ofcourse, restoration is also very smooth in it. with just one click, you can restore to any point in time back.
    – Farhan
    Nov 8, 2011 at 9:23

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .