Translate

Wednesday, 7 February 2024

Zextras Carbonio CE / Zimbra CE backup script


#!/bin/bash
# Run as root
datevar=`date +%Y%m%d%H%M`

# Destination folder. In this example /opt/backups/zextras
mybakdir="/opt/backups/zextras/${datevar}"
mkdir -p $mybakdir
mkdir -p $mybakdir/ldap_bak

# Copy everything but not LDAP
rsync --delete -aHK --exclude 'data.mdb' /opt/zextras $mybakdir

# Backup LDAP
/opt/zextras/common/bin/mdb_copy /opt/zextras/data/ldap/mdb/db $mybakdir/ldap_bak

# Stop Carbonio and backup the locked files
su - zextras -c "/opt/zextras/bin/zmcontrol stop"
/bin/sync

rsync --delete -aHK --exclude 'data.mdb' /opt/zextras $mybakdir

# Start Carbonio and create a tar file & move. In this example we move to /mnt/smb/zextras/
su - zextras -c "/opt/zextras/bin/zmcontrol start"

tar -cf /mnt/smb/zextras/zextras-${datevar}.tar ${mybakdir}


Reference: https://community.zextras.com/forum/carbonio-general-thread/mail-backup-and-restore/


No comments:

Post a Comment

Featured post

Let People Be Themselves, and Let Yourself Be Honest

   BE HONEST. STAY FREE. CHANGE WILLINGLY. Two reflections on love, expectation and the freedom to be real by Kesari Babu  |  kesaribabu I. ...