Here's a little script I whipped up, based on the 'simple shell script' on the Wiki to backup to Amazon S3 service. This presumes that you have the s3sync ruby package installed and configured.


# System Backup Script, include Zimbra Backup
# Requires s3sync (with s3cmd) to run

# Live sync before stopping Zimbra to minimize sync time with the services down
rsync -avHK --delete /opt/zimbra/ /backup/zimbra

# Stop the Zimbra Services
sudo -u zimbra /opt/zimbra/bin/zmcontrol stop
sleep 20

# Sync to backup directory
rsync -avHK --delete /opt/zimbra/ /backup/zimbra

# Restart the Zimbra service
sudo -u zimbra /opt/zimbra/bin/zmcontrol start
sleep 20

# Include a text file with the current Zimbra version
sudo -u zimbra zmcontrol -v > /backup/zimbra/conf/zimbra_version.txt

# Create a tarball of the backup folder
timestamp=`(date +%F_%H.%M.%S)`
tar -zcvf /tmp/backup_${timestamp}_zimbra.tgz -C /backup/zimbra .

# Upload to S3
echo "Beginning upload to S3"
/root/s3sync/s3sync/s3cmd.rb put bucket:backup_${timestamp}_zimbra.tgz /tmp/backup_${timestamp}_zimbra.tgz
echo "Uploaded to S3"

# Remove the uploaded file
rm /tmp/backup_${timestamp}_zimbra.tgz
Obviously, replace bucket with a bucket of your choice.

~ Christopher