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 need some advise to create a script that runs at night on my IMAP mail server, and backup all the mailboxes (50) and once the backup is done, burn such file in a DVD.


Im runing CentOS 5.x & iRedMail with mysql backend, DOVECOT and virtual accounts.

What could be the best procedure to accomplish an IMAP mailboxes backup and what tools should I use?..


share|improve this question
You'll probably get some better responses if you can share what type of IMAP server you have, what operating system it is on, and what kind of scripting languages you are comfortable with. – Jed Daniels Jun 14 '10 at 18:41
mysql dump to file, burn directly to CD/DVD (or use mkisofs if you want the CD to have a readable file system). – Chris S Jun 14 '10 at 18:57

Your mail is therefore actually stored in mysql, right? So you need to backup that mysql database somehow (mysqldump or mysqlhotcopy or the like), and then burn said backup to a DVD by first creating a DVD filesystem (via mkisofs) and then burning said filesystem to the raw DVD (via cdrecord or the like).

If it's actually stored in files, then you'll want to look into the multivolume support of tar or afio or the like. If all else fails, I'm sure you can do it with tar and split and the cdrecord the result.

Hopefully there's enough keywords in there to give you some pointers.

share|improve this answer
My mail uses mysql to store vmail accounts and domains, as alias an so on. The email are stored on folders and files for each user and domain. What I need is to backup this data from files without breaking mailboxes, and split all the backup in tar or bzip files no longer than 4GB each. – Paul Stevens Jun 17 '10 at 15:09

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.