Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question

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.

share|improve this answer

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.

share|improve this answer

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.

share|improve this answer
Forget? FORGET? Backups are not to be forgotten, one needs to test restore possibilities regularly. Backing up is easy, restoring is the tricky part. – Janne Pikkarainen Nov 8 '11 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 '11 at 9:23

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.