Its a nice and simple script, often the best type! The way I am currently handling the backup (as a test) is for my backup server to rsync the zimbra data to local storage. This basically using the diff function but called from a remote server. We're still using Retrospect (gasp) which simply backups the zimbra sync for us. Below is the basics of the script. This is called from my backup server, not on the Zimbra server. My central backup server goes out to many different servers each day and does a sync to a local storage device. Then Retrospect simply backups the local storage device.
Code:
#!/bin/bash
RSYNC=/usr/bin/rsync
RSYNC_ARGS="-avHPK --exclude=whatever"
archiveDir=/Volumes/raid3-2/server_backups
###### ZCS server ######
remoteServer=zcs.mydomain.com
remotePath=/opt
localDir=$archiveDir/zmail
user=root
# Make local backup directory
mkdir -p $localDir
# Hot sync before shutdown on zimbra folder
$RSYNC $RSYNC_ARGS --delete -e ssh "$user@$remoteServer:$remotePath" $localDir
# Shutdown Zimbra
ssh $user@$remoteServer '/etc/init.d/zimbra stop'
sleep 20
# Cold sync of zimbra folder
$RSYNC $RSYNC_ARGS --delete -e ssh "$user@$remoteServer:$remotePath" $localDir
# Start Zimbra
ssh $user@$remoteServer '/etc/init.d/zimbra start'