##!/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"`
## Backup location separate by date
ZDUMPDIR=$ZBACKUP/$DATE
## zmmailbox location
ZMBOX=/opt/zimbra/bin/zmmailbox
### Backup Option ###
## Based on few day ago until today, example 7 days ago
#HARI=`date --date='7 days ago' +"%m/%d/%Y"`
#query="&query=after:$HARI"
if [ ! -d $ZDUMPDIR ]; then
mkdir -p $ZDUMPDIR
fi
## Looping Account Zimbra
for account in `su - zimbra -c 'zmprov -l gaa | sort'`
do
echo "Processing mailbox $account backup..."
$ZMBOX -z -m $account getRestURL "//?fmt=${FORMAT}$query" > $ZDUMPDIR/$account.${FORMAT}
done
echo "Zimbra Mailbox backup has been completed successfully."
echo "Sending files to backup all email accounts for Machine2 ..."
rsync -avH $ZBACKUP root@ipaddress:/backup/zimbra_backup_accounts
before2="$(date +%s)"
#
echo The process lasted = $(date +%T)
# Calculating time
after="$(date +%s)"
elapsed="$(expr $after - $before)"
hours=$(($elapsed / 3600))
elapsed=$(($elapsed - $hours * 3600))
minutes=$(($elapsed / 60))
seconds=$(($elapsed - $minutes * 60))
echo The complete backup lasted : "$hours hours $minutes minutes $seconds seconds"
Script backup zimbra mail
Related Posts:
Xây dựng mail server postfix và quản lý email bằng php mysql Trước đây tôi đã có một bài viết hướng dẫn triển khai mail server đơn giản trên hệ điều hành linux, sử dụng các user của hệ điều hành làm email account. Nay tôi tiếp tục phát triển hướng này và chia sẻ cách để có thể quản lý… Read More
Copy Outgoing Email on a cPanel Server with Exim Note: It is mentioned in the comments that recent versions of cPanel include an Email Archiving feature that stores copies of email on the server for you. If this is what you’re trying to do, this featur… Read More
How do I delete thousands of e-mail messages with cPanel or Horde's webmail interface? Answer: How do I delete thousands of e-mail messages with cPanel or Horde's webmail interface? If you run a website, you may find out one day that you have a mail account containing thousands of messages — or possibly … Read More
CÁC LỆNH THAO TÁC TRÊN EXIM SỬ DỤNG CONTROL PANEL DIRECTADMIN Exim là một SMTP Server tốt, tuy nhiên đôi lúc bạn cũng phải thao tác để quản lý hàng đợi (Queue) trong trường hợp các user gởi quá nhiều email, hoặc bị Spam làm tắc nghẽn. Hiển thị danh sách các email đang nằm trong Mail … Read More
Cấu hình chứng thực SMTP hợp lệ trên Exim Việc cấu hình này sẽ giải quyết được dứt điểm vấn đề gửi thư giả mạo bằng cách ràng buộc phải chứng thực SMTP rõ ràng. Qua đó, hạn chế được rất nhiều việc Spam mail trên Linux. Các bước cấu hình và thiết lập n… Read More
0 comments:
Post a Comment