Zimbra offers Open Source email server software and shared calendar for Linux and the Mac
Go Back   Zimbra :: Forums > Zimbra Collaboration Suite > Administrators

Welcome to the Zimbra :: Forums!
Welcome, if you would like to post a comment please register. We also encourage you to explore all things Zimbra with our team and members of the community.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-26-2010, 10:25 AM
New Member
 
Posts: 3
Default ZCS OSE hot backup via REST

Hello,

in addition to a cold backup, I'm trying to implement a hot backup for individual accounts via REST.

I found something here : Live Backup For Zimbra FOSS Edition #!/Dudi/Gurnadi

I modified and tested this script on a ZCS 6.02 FOSS.

I'd like to have the opinion of some other ZCS FOSS admins.

Here's the script :

Code:
#!/bin/bash
### RESTORE COMMAND :
### zmmailbox -z -m $ACCOUNT postRestURL "//?fmt=tgz&resolve=reset" /backupdir/$ACCOUNT.tgz
### START CONFIGURATION ###
### Dir for compressed account archives 
DIR="/tmp/zimbra";
### Dir for final backup archive
OUTPUT="/tmp/zimbra";
### Logfile filename (without .log)
LOGFILE="backlog"
### END OF CONFIGURATION ###

USERS=`su - zimbra -c 'zmprov -l gaa'`;
DATE=`date +%Y%m%d`;

if [ ! -d $DIR ]; then mkdir $DIR; chown zimbra:zimbra $DIR; fi
cd $DIR;
if [ ! -d $DATE ]; then mkdir $DATE; chown zimbra:zimbra $DATE; fi

for ACCOUNT in $USERS; do
        SHORTNAME=`echo $ACCOUNT | awk -F. '{print $1}'`;
		case $SHORTNAME in
			"ham") echo "Skipping : "$ACCOUNT;
				echo "Skipping : "$ACCOUNT >> $LOGFILE"_"$DATE.log;;
			"spam") echo "Skipping : "$ACCOUNT;
				echo "Skipping : "$ACCOUNT >> $LOGFILE"_"$DATE.log;;
			*) echo "Backing up : "$ACCOUNT;
			echo "Backing up : "$ACCOUNT >> $LOGFILE"_"$DATE.log;
	        su - zimbra -c "zmmailbox -z -m $ACCOUNT getRestURL '//?fmt=tgz' > $DIR/$ACCOUNT.tgz";;
		esac
done
cd $DIR; mkdir $DATE; mv *.tgz $DATE
echo "Compressing backups in a single archive";
tar cjpf $OUTPUT/$DATE.tar.bz2 $DATE;
cd $DIR; rm -rf $DATE
As a side question, did someone test this script on ZCS 6.08 ?

Thank you for any input on this crucial subject.

Last edited by mcordas; 10-27-2010 at 07:42 AM.. Reason: mistake in script
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads

Why Join?

Registering let's you ask questions, makes it easier to search, displays any files attached to posts, and notifies you about replies.

blog.zimbra.com




 

SEO by vBSEO ©2011, Crawlability, Inc.