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

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 01-31-2009, 08:47 AM
Mat Mat is offline
Intermediate Member
 
Posts: 20
Default backup on open source

hi

I use this script
#!/bin/bash

time=`date +%Y-%m-%d_%H-%M-%S`

# Modify the following variables according to your installation
#########################################

# backup_dir - directory to backup to
backup_dir=/opt/zimbra/backups/$time

# vol_group - the Volume Group that contains $zimbra_vol
vol_group=VolGroup00

# zimbra_vol - the Logical Volume that contains /opt/zimbra
zimbra_vol=LogVol03

# zimbra_vol_fs - the file system type (ext3, xfs, ...) in /opt/zimbra
zimbra_vol_fs=ext3

# lvcreate and lvremove commands path -
lvcreate_cmd=/usr/sbin/lvcreate
lvremove_cmd=/usr/sbin/lvremove

# Do not change anything beyond this point
#########################################

# Test for an interactive shell
if [[ $- != *i* ]]
then say() { echo -e $1; }
# Colors, yo!
GREEN="\e[1;32m"
RED="\e[1;31m"
CYAN="\e[1;36m"
PURPLE="\e[1;35m"
else say() { true; } # Do nothing
fi

# Output date
say $GREEN"Backup started at "$RED"`date`"$GREEN"."

# Stop the Zimbra services
say $CYAN"Stopping the Zimbra services..."
say $PURPLE" This may take several minutes."
/etc/init.d/zimbra stop

# Create a logical volume called ZimbraBackup
say $GREEN"Creating a LV called ZimbraBackup:"$PURPLE
$lvcreate_cmd -L1000M -s -n ZimbraBackup /dev/$vol_group/$zimbra_vol

# Create a mountpoint to mount the logical volume to
say $GREEN"Creating a mountpoint for the LV..."
mkdir -p /tmp/ZimbraBackup

# Mount the logical volume to the mountpoint
say $GREEN"Mounting the LV..."
mount -t $zimbra_vol_fs -o nouuid,ro /dev/$vol_group/ZimbraBackup /tmp/ZimbraBackup/

# Start the Zimbra services
say $CYAN"Starting the Zimbra services..."
/etc/init.d/zimbra start &

# For testing only
#say $RED"Press Enter to continue...\e[0m"
#read input

# Create the current backup
say $GREEN"Creating the backup directory and backup..."
mkdir -p $backup_dir
tar zcvf $backup_dir/zimbra.backup.tar.gz /tmp/ZimbraBackup/zimbra/ 2&> /dev/null

# Unmount /tmp/ZimbraBackup and remove the logical volume
say $GREEN"Unmounting and removing the LV."$PURPLE
umount /tmp/ZimbraBackup/
$lvremove_cmd --force /dev/$vol_group/ZimbraBackup

# Done!
say $GREEN"Zimbra backed up to "$CYAN$backup_dir$GREEN"!"
say $GREEN"Backup ended at "$RED"`date`"$GREEN".\e[0m"


i've got this error :

Backup started at sam jan 31 17:36:31 CET 2009.
Stopping the Zimbra services...
This may take several minutes.
Creating a LV called ZimbraBackup:
Rounding up size to full physical extent 1,00 GB
Insufficient free extents (0) in volume group VolGroup00: 32 required
Creating a mountpoint for the LV...
Mounting the LV...
mount: périphérique spécial /dev/VolGroup00/ZimbraBackup n'existe pas
Starting the Zimbra services...
Creating the backup directory and backup...
Unmounting and removing the LV.
umount: /tmp/ZimbraBackup/: n'est pas monté
One or more specified logical volume(s) not found.
Zimbra backed up to /opt/zimbra/backups/2009-01-31_17-36-31!
Backup ended at sam jan 31 17:37:01 CET 2009.

can you help me ? can i use an other script ?

thanks
Reply With Quote
  #2 (permalink)  
Old 01-31-2009, 08:58 AM
Active Member
 
Posts: 49
Default

I recommend you look here, these are the latest backup scripts. The one you have seems to be old:

Open Source Edition Backup Procedure - Zimbra :: Wiki

Last edited by Mccreations; 01-31-2009 at 09:01 AM..
Reply With Quote
  #3 (permalink)  
Old 02-01-2009, 03:10 AM
Mat Mat is offline
Intermediate Member
 
Posts: 20
Default

hi,

what script you advise me, i want a simple script.

thanks
Reply With Quote
  #4 (permalink)  
Old 02-01-2009, 03:42 AM
Moderator
 
Posts: 7,928
Default

That is very much personal preference ... Whatever one you choose ensure you are also comfortable with the recovery aspect.
__________________
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.