-   Linux - Newbie (
-   -   Backup Mail from One server to another (

shipon_97 06-26-2006 07:03 AM

Backup Mail from One server to another
Friends ,

I need some help about my mail server . I have a Mail server where "All OutSide" Mail is stored , suppose it's IP is I have another server which is locally used (Ip . Both server i have configured Sendmail .

Now i want to BACKUP my mail from REAL server to LOCAL network server . So that my mail is not destroyed . Is it possible ? If it is possible plz inform me .......


IBall 06-26-2006 07:16 AM

I think that mail is usually stored in /var/mail/. Therefore, you should be able to use rsync to copy the mail from the actual server to the backup server. On the local server:

rsync -avz userName@ ~/mailBackup
Obviously, "userName" is a user on the remote system, with read access to /var/mail. In this case, the mail is being backed up to /home/localUser/mailBackup.

I hope this helps

SlackDaemon 06-26-2006 07:40 AM


What IBall said is correct but keep in mind that mail is moved from /var/spool/mail/<username> files to the respective users home directory ($HOME/mbox or $HOME/Mail) once an email has been read. be sure to back these up as well if you wish to preserve existing mail.

best of luck!

shipon_97 06-26-2006 01:03 PM

Mail BNackup from One Server to Other server
Dear IBall ,

1) I want , My mail backup system does work automatically i.e., My Mail restore from Main server to others automatically . Is there any solution regarding this purpose ?

2) When i backup my mail , then using which server , i need to take my backup ? From Network server ( ) ?

Sorry for disturb ..........

w3bd3vil 06-26-2006 01:45 PM

you could as well create aliases for the users that you want to backup.

Bonestein 06-26-2006 05:17 PM

create a file and put IBalls line in there and chomd u+x or 777 or whatever you want to do to make the file executable.


rsync -avz userName@ ~/mailBackup
for autmation, create a entry in the crontab to have this command run each day or twice a day


crontab -e
should allow you to make an entry

just read the man file, it's pretty short and to the point.

IBall 06-26-2006 09:36 PM


2) When i backup my mail , then using which server , i need to take my backup ? From Network server ( ) ?
The rsync line I gave you above will copy whatever is in /var/mail on the public server 202.x.x.x to the specified directory on the private server 192.168.x.x.

Rsync will only copy files from the remote server that have been modified since the local copy was modified.


All times are GMT -5. The time now is 09:06 PM.