extmail备份

本文摘自:http://www.extmail.org/forum/thread-11226-1-1.html

1,使用rsync备份
#vi /etc/xinetd.d/rsync
disable=no 默认为yes
#vi /etc/rsync.conf  这里我将/home/domains与黑白名单使用rsync共享出来
[extmail]
        path=/home/domains
        auth users=extmail
        uid=root
        gid=root
        secrets file=/etc/rsyncd.secrets
        read only=yes
[amavis]
        path=/var/amavis
        auth users=extmail
        uid=root
        gid=root
        secrets file=/etc/rsyncd.secrets
        read only=yes
然后再准备一台机器,将另外一台机器按上述方法再配置一次,使用crontab将生产使用的邮件每6小时同步一次.
crontab内容:
rsync -vzrtopg --delete --progress [email protected]::extmail /home/domains --password-file=/etc/rsyncd.secretes
rsync -vzrtopg --delete --progress [email protected]::amavis /var/amavis --password-file=/etc/rsyncd.secretes

2,备份
#vi /root/autoback 添加以下内容
mount -t cifs -o username=extmail,password="password" //192.168.1.50/extmail /mnt/backup
mkdir /mnt/backup/extmail`date +%y%m%d`
mysqldump -u root -p123456 --opt extmail >/mnt/backup/extmail`date +%y%m%d`/extmail`date +%y%m%d`.sql
tar -zcvf /mnt/backup/extmail`date +%y%m%d`/postfix`date +%y%m%d`.tar.gz /etc/postfix
tar -zcvf /mnt/backup/extmail`date +%y%m%d`/extsuite`date +%y%m%d`.tar.gz /var/www
tar -zcvf /mnt/backup/extmail`date +%y%m%d`/log`date +%y%m%d`.tar.gz /var/log
tar -zcvf /mnt/backup/extmail`date +%y%m%d`/home`date +%y%m%d`.tar.gz /home
tar -zcvf /mnt/backup/extmail`date +%y%m%d`/amavis`date +%y%m%d`.tar.gz /var/amavis
umount /mnt/backup
然后将autoback添加进crontab
#crontab -e
30 2 * * * /root/autoback  每天2:30备份一次


你可能感兴趣的:(备份,ExtMail)