December 23, 2015

Backup of Zimbra MailBox using zmmailbox

This is a short script I use to backup the Zimbra mailbox content for my users.
This has been used on a Zimbra Collaboration Server (ZCS Open Source Edition) 7.2 installation, but should work on earlier versions as well.
I use another script to backup the whole Zimbra installation, but that might be another blog post.

#!/bin/bash -x
# Backup of Zimbra mailboxes using zmmailbox
# Restore of mailbox should be performed using:
# /opt/zimbra/bin/zmmailbox -z -m user@host postRestURL -u https://HOST "//?fmt=tgz&resolve=skip" mailbox-name-date.tgz
BackupFolder="/backup/zimbra"
MailBox="user1 user2 user3 userN"
DateToday=`date -I`
for name in $MailBox
do
sudo -u zimbra /opt/zimbra/bin/zmmailbox -z -m $name@pario.no getRestURL "//?fmt=tgz" > mailbox-$name-$DateToday.tgz
done
The backup files are named mailbox-user1-20120802.tgz mailbox-user2-20120802.tgz …

Related Posts:

  • Script Tự động sao lưu toàn bộ website WordPress Thông thường, khi mình muốn di chuyển hoặc sao lưu một website sử dụng WordPress thì sẽ sử dụng plugin Duplicator. Tuy nhiên, có một số trường hợp server bị lỗi, website không truy cập trực tiếp được hoặc bạn muốn sao l… Read More
  • using shell script to automate install VPS linux Vì tính chất công việc, nên đôi khi mình phải setup khá nhiều VPS để dùng. Đặc biệt là các VPS linux, tuy nhiên chỉ cần setup Apache + PHP + mysql + phpMyAdmin là đủ cho 1 cuộc tình Vì phải lặp đi lặp lại 1 mớ lệnh, mà … Read More
  • Script backup zimbra mail##!/bin/bash clear echo Start time of the backup = $(date +%T) before="$(date +%s)" ## Backup Format FORMAT=tgz ## Backup location ZBACKUP=/srv/backup/ ## Folder name for backup and using date DATE=`date +"%d%m%y"` ## Bac… Read More
  • MYSQL BAKUP USING SHELLS SCRIPTS Kindly find the MYSQL shells scripts in given below.-------------------------------------------------------------------------------------------------------#! /bin/bash# You are free to modify and distribute this code,# so… Read More
  • Scripts for backup website ####################################################################### ## AURELIEN HUSSON ## ## Script backup website and Database ## ## Info : ## ## Exemple : website find in /home/www/website/publ… Read More

0 comments:

Post a Comment