วันจันทร์ที่ 26 พฤศจิกายน พ.ศ. 2555

Zimbra Backup / Restore

Zimbra Backup / Restore  จากประสบการณ์อันน้อยนิด ^^


#สั่ง service zimbra ให้หยุด
service zimbra stop

# get ค่าของ today ให้เป็น วันที่_เวลา
today=$(date '+%y%m%d_%H%M%S')




#สร้าง Folder ตามด้วยค่าของ today ที่ getมาได้
mkdir /mnt/bk/mail/"$today"

cd /mnt/bk/mail/"$today"


#tar ข้อมูลของ /opt/zimbra/  เข้ามาเก็บไว้ยังปลายทาง
tar cvf backup_mail-"$today".tar /opt/zimbra/
#Run service ต่อ
service zimbra start

* ถ้าเราใช้การ cp /opt/zimbra/ ไว้ก่อนคำสั่งที่จะได้ service หยุด แล้วใช้ rsync แทนจะทำให้ใช้เวลาน้อยกว่า


การ Restore
chown -R zimbra:zimbra /opt/zimbra/st*

***************************************************************

Zimbra backup

The Following code is an example for Zimbra backup script, from The Jonas tutorial video.
Code is below – copy and save into an empty file and adjust accordingly:
!/bin/bash
service zimbra stop
cp -rp /opt/zimbra /location_of_your_backup_folder/`date +%y%m%d`/
service zimbra start
For the permissions, right click on file and set permissions to allow executing.
Then if you need to restore your zimbra E-mail server from backup, stop the zimbra service, move your zimbra backup, rename it to zimbra, and place it in the original location as follows: /opt/zimbra
Then run this permission code: chown -R zimbra:zimbra /opt/zimbra/st*
Then start-up the zimbra service.
I hope this helps ~thejonas.net


Credit  http://www.thejonas.net


ไม่มีความคิดเห็น:

แสดงความคิดเห็น