Results 1 to 4 of 4

Thread: backup on open source

  1. #1
    Mat
    Mat is offline Active Member
    Join Date
    Dec 2007
    Posts
    25
    Rep Power
    7

    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

  2. #2
    Mccreations is offline Active Member
    Join Date
    Mar 2008
    Location
    Chicago, IL
    Posts
    49
    Rep Power
    7

    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 10:01 AM.

  3. #3
    Mat
    Mat is offline Active Member
    Join Date
    Dec 2007
    Posts
    25
    Rep Power
    7

    Default

    hi,

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

    thanks

  4. #4
    uxbod's Avatar
    uxbod is offline Moderator
    Join Date
    Nov 2006
    Location
    UK
    Posts
    8,017
    Rep Power
    24

    Default

    That is very much personal preference ... Whatever one you choose ensure you are also comfortable with the recovery aspect.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. ISP mail connection errors out
    By egottwald in forum Error Reports
    Replies: 1
    Last Post: 10-13-2008, 10:59 PM
  2. [Installation] Zimbra Desktop - Ubuntu 8.04 Hardy
    By kaltera in forum Installation Help
    Replies: 1
    Last Post: 06-18-2008, 04:43 AM
  3. [SOLVED] Is zimbra really open source product ?
    By hernad in forum Developers
    Replies: 3
    Last Post: 08-18-2007, 10:30 PM
  4. Error message in Server status
    By Max Ma in forum Installation
    Replies: 20
    Last Post: 04-19-2007, 08:55 AM
  5. M3 problem with shares
    By titangears in forum Users
    Replies: 4
    Last Post: 01-12-2006, 01:01 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •