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

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
  #71 (permalink)  
Old 06-06-2006, 11:24 AM
Former Zimbran
 
Posts: 294
Default Thanks Kevin ...

Thanks Kevin,

(I now feel guilty when anyone from Zimbra replies on this thread)

Thank-you very much for Zimbra.
__________________
Regards,

Chintan Zaveri
(Yet another ZIMBRAN!)

"Dhundhne par Bhagwan bhi ..."
Reply With Quote
  #72 (permalink)  
Old 06-07-2006, 06:22 PM
Zimbra Employee
 
Posts: 515
Default

hey also if you put the account in maintenance mode you can't access via imap(sync)
__________________
Search the Forums - Bugzilla - Wiki - Downloads
Reply With Quote
  #73 (permalink)  
Old 06-29-2006, 04:00 PM
Loyal Member
 
Posts: 83
Default

ok just an update-

how i've been doing my backups for the past month:

stop zimbra

sleep 1m

flush

grep ps for zimbra, and kill them if they haven't stopped yet

grab a LVM readonly snapshot of the /opt/zimbra directory

start zimbra

tar and scp zimbra based on the new snapshot

delete the snapshot


I'll put a script up once i clean things up a bit...
Reply With Quote
  #74 (permalink)  
Old 07-03-2006, 12:01 PM
Active Member
 
Posts: 37
Default

Quote:
Originally Posted by robbyt
ok just an update-

how i've been doing my backups for the past month:

stop zimbra

sleep 1m

flush

grep ps for zimbra, and kill them if they haven't stopped yet

grab a LVM readonly snapshot of the /opt/zimbra directory

start zimbra

tar and scp zimbra based on the new snapshot

delete the snapshot


I'll put a script up once i clean things up a bit...
I'll be interested in that, i've already got a few different types of backups going on, but i'm not convinced by the reliability of some of the methods...

John
Reply With Quote
  #75 (permalink)  
Old 07-06-2006, 06:23 AM
Junior Member
 
Posts: 8
Lightbulb

I thought you may be interested in a few modifications I made to the LVM backup script posted earlier in the thread.

Code:
#!/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=/tmp/backups/$time

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

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

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

# Test for an interactive shell
if [[ $- != *i* ]]
   then say() { echo -e "$*"; }
     # 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
/usr/sbin/lvcreate -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 /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..."
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/
/usr/sbin/lvremove --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"
Let me know if you have any feedback.
-Dana

Last edited by dana.merrick; 07-06-2006 at 09:35 AM..
Reply With Quote
  #76 (permalink)  
Old 07-06-2006, 08:01 AM
Former Zimbran
 
Posts: 5,606
Default

Dana,
What a wonderful script.
Would you mind editing the wiki and posting in there for others?

Thanks
john
Reply With Quote
  #77 (permalink)  
Old 07-09-2006, 12:04 AM
Special Member
 
Posts: 118
Default

What modifications should I do to do this without LVM
The System has LVM but not in the /opt/zimbra, it is in the root directory /
how can I use this script just making the backup to nomal directories??
Reply With Quote
  #78 (permalink)  
Old 07-10-2006, 09:35 AM
Loyal Member
 
Posts: 83
Default

hey dana, i found that doing a zimbra service stop doesn't always get everything closed down nice and clean, so i throw this after the service stop command in my script:

Code:
sleep 30
kill -9 `ps -U zimbra|grep [0-9]|awk '{print $1}'` > /dev/null
Reply With Quote
  #79 (permalink)  
Old 07-10-2006, 09:54 AM
Loyal Member
 
Posts: 83
Default

Quote:
Originally Posted by kowell
What modifications should I do to do this without LVM
The System has LVM but not in the /opt/zimbra, it is in the root directory /
how can I use this script just making the backup to nomal directories??

here is a copy of my old coldbackup script, pre lvm...
just a warning! it's a bit ugly
This script will scp the backup file off to another computer for safe storage. YMMV!

Code:
#!/bin/bash
DATE=`date +%b%d`
ZMDATA=/opt/zimbra
BACKUPFILE=/opt/zimbra-$DATE.tar.gz
DEST=zimbrabak@srvfile01:/home/archive/zimbra/backup.tar.gz
LOG=/root/zimbra/backup.log


echo "started at `date`" >  $LOG
echo "___________________________________" >> $LOG


/etc/init.d/zimbra stop
sleep 30
sudo -u zimbra /opt/zimbra/bin/zmcontrol stop
sleep 30

echo "" >> $LOG
echo "process list after first zimbra stop:" >> $LOG
ps -U zimbra >> $LOG

#lets clean up any left-overs...
kill -9 `ps -U zimbra|grep [0-9]|awk '{print $1}'` > /dev/null
sleep 10


echo "" >> $LOG
echo "process list after kill `date`:" >> $LOG
ps -U zimbra >> $LOG


cd /opt
tar -czf $BACKUPFILE $ZMDATA


/etc/init.d/zimbra start &

#now let's xfer this to $DEST
scp -i /root/.ssh/zimbrabak $BACKUPFILE $DEST
rm -rf $BACKUPFILE &
you can ignore all of the logging stuff- i was having issues with some of the services not closing down all the way so i threw some basic logging in.
Reply With Quote
  #80 (permalink)  
Old 08-20-2006, 10:10 AM
Junior Member
 
Posts: 5
Default Fyi...

I don't know if this would be considered a bug in the backup script on the wiki or just a "watch out".

But, my /opt/zimbra directory is the logical volume. Not a subdirectory.
Code:
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/hda2              6940516   3188004   3394264  49% /
/dev/hda1               101086      9363     86504  10% /boot
/dev/shm                119784         0    119784   0% /dev/shm
/dev/mapper/mail-pmail
                       5039616    739268   4044348  16% /opt/zimbra
/dev/shm                153600         0    153600   0% /opt/zimbra/amavisd-new-2.3.3/tmp
So, line 62 of the script (the tar line) which originally looks like this:

Code:
tar zcvf $backup_dir/zimbra.backup.tar.gz /tmp/ZimbraBackup/zimbra/ 2&> /dev/null
Should probably look more like this:

Code:
tar zcvf $backup_dir/zimbra.backup.tar.gz /tmp/ZimbraBackup/ 2&> /dev/null
Unless I have my volumes set up incorrectly. But, I really don't want to make my lv /opt. I may place other things in there that I don't want taking up space on the zimbra volume.
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.