Results 1 to 9 of 9

Thread: Zimbra Open Source Backup Help

  1. #1
    ayush1440 is offline Loyal Member
    Join Date
    Apr 2008
    Location
    Ahmedabad, INDIA.
    Posts
    76
    Rep Power
    0

    Default Zimbra Open Source Backup Help

    Hello frends,

    I am new to zimbra. I have Fedora core 7 live and running and working zimbra Open source latest edition. Now I want to backup whole zimbra to another system. For this i found such scripts for zimbra Open source backup.

    But can u suggest which script is best for me and also tested as per my Linux distro?

    and another question is if there is possible for live synchronizing of zimbra open source?

    i found Scripts to sync to a remote Zimbra backup machine - Zimbra :: Wiki
    this. Is this working and LIVE synchronize is advisable?

    Please help would be really appreciated.

    Thank you very much in advance.

  2. #2
    phoenix is online now Zimbra Consultant & Moderator
    Join Date
    Sep 2005
    Location
    Vannes, France
    Posts
    23,583
    Rep Power
    57

    Default

    All of the scripts are community supplied and one can assume they've been tested by the original authors. Your best option will be to try each of the scripts and see which one suits your needs, don't forget you'll also need to run a restore to test your disaster recovery procedures. You'll also find some details in the forums on backup/restore scripts, please search for them.
    Regards


    Bill


    Acompli: A new adventure for Co-Founder KevinH.

  3. #3
    ayush1440 is offline Loyal Member
    Join Date
    Apr 2008
    Location
    Ahmedabad, INDIA.
    Posts
    76
    Rep Power
    0

    Default

    Quote Originally Posted by phoenix View Post
    All of the scripts are community supplied and one can assume they've been tested by the original authors. Your best option will be to try each of the scripts and see which one suits your needs, don't forget you'll also need to run a restore to test your disaster recovery procedures. You'll also find some details in the forums on backup/restore scripts, please search for them.
    I searched on Forums and after that i found that scripts. I also tested some script but problem is getting error when i enable ftp upload.

    And can u tell me about live Sync to remote zimbra server?

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

    Default

    This is not a live sync as it is based on a cronjob so you could potentially loose some emails if the primary server was to fail. If you wanted online backups you would need to purchase the NE version of ZCS.

  5. #5
    ayush1440 is offline Loyal Member
    Join Date
    Apr 2008
    Location
    Ahmedabad, INDIA.
    Posts
    76
    Rep Power
    0

    Default

    Ok.. Thank you for information. I am working on Script for Backup and restore.

    thanks for your quick reply.

  6. #6
    ayush1440 is offline Loyal Member
    Join Date
    Apr 2008
    Location
    Ahmedabad, INDIA.
    Posts
    76
    Rep Power
    0

    Default Found Script

    I found a Backup Script for this. It works for me. But problem is when I enable FTP/SCP, the script cannot run. Can you please see this script and solve my problem.

    When run this script after enable FTP/SCP. Error shows
    "expect command is missing, this is required for file transfer options, script exiting..."

    Code:
    #!/bin/bash
    
    # This script will do various backups of Zimbra depending on wich you choose,
    # most of them are cold backups except the msg backup which hot copies the 'store'
    # folder for possible individual mail retrival. Be sure to change the variables below
    # to point to where you got the zimbra folder and where you want it to be backed up to.
    #
    # This script must be run as root or a user with equal privileges or it will not work.
    #
    # Usage: ZimBackup.sh full	- For full backup (Cold)
    #	 ZimBackup.sh diff	- For diffrential backup (Cold)
    #	 ZimBackup.sh msgfull	- For complete message backup (Hot)
    #	 ZimBackup.sh msgdiff	- For diffrential message backup (Hot)
    #
    # When you run this script via crontab be sure to add '> /dev/null 2>&1' at the end
    # of the script like below or the tar command will fail for no apparent reason.
    # 00 12 * * * ZimBackup.sh full > /dev/null 2>&1
    #
    # As of 2008-04-16 this script uses some extra software to extend this script,
    # the scripts standard function will still function without these extra softwares but if you
    # intend to use this scripts built in file transfer functions you must install the described software below.
    #
    # Required software: expect & any software dependencies for this package.
    #
    # Bits and pieces was adopted from a script created by Daniel W. Martin, 9 Sept 2007
    # Free to use and free of any warranty!  Marcus Uddenhed, 3 feb 2008
    #
    # Last updated: 2008-06-10
    
    #### Global Settings ####
    ZimInstPath=/opt			# Installation path for Zimbra, exluding the zimbra folder.
    ZimHome=zimbra				# The Zimbra installation folder, exluding path to folder.
    ZimBackupPath=/backup			# Backup folder where backup files should be placed.
    ZimTempPath=/backup/tmp			# Temporary backup folder, should be placed as a subfolder to backup folder.
    
    #### Log Settings ####
    ZimLogEnable=yes				# Turns logging off or on.
    ZimLogFileName=BackupZimbra.log		# Log filename
    ZimLogVerbose=yes			# Activates extra logging information 
    
    #### File Transfer Settings ####
    
    # Enable Services (yes/no)
    ZimFtpEnable=yes				# Enable/Disable ftp file transfer.
    ZimScpEnable=no				# Enable/Disable scp file transfer.
    
    # Extra FTP Settings
    ZimFtpOpt=''				# Extra options for ftp file transfer, see manual for ftp command
    
    # Extra SCP Settings
    ZimScpOpt=''				# Extra options for ftp file transfer, see manual for scp command
    
    # Common Settings
    ZimFilehostUser=Backuphost			# Username for file transfers
    ZimFilehostPass=Password			# Password for file transfers
    ZimFilehostAddress=X.X.X.X			# Host address for file transfers
    ZimFilehostFolder=/zimbackup/		# Folder on host where files will be placed during file transfer
    
    #### File Delete Settings ####
    ZimDeleteLocalFile=no			# Enable/Disable backup file deletion efter sucessfull backup.
    ZimDeleteTimeSet=0			# Set in minutes above 0 to keep a desired amount of files locally,
    					# be sure to match the time with your backup schedules.
    
    ##### Do not change anything below this line unless you know what you are doing #####
    
    # Fetch backup type 
    ZimBackupType=$1
    
    # Set filename for backup files
    ZimFilenameSystemFull=ZimBackupSystemFull_`date +%Y%m%d%H%M`.tar.gz
    ZimFilenameSystemDiff=ZimBackupSystemDiff_`date +%Y%m%d%H%M`.tar.gz
    ZimFilenameMsgFull=ZimBackupMsgFull_`date +%Y%m%d%H%M`.tar.gz
    ZimFilenameMsgDiff=ZimBackupMsgDiff_`date +%Y%m%d%H%M`.tar.gz
    
    pre_check() {
    # Check if expect is installed and file transfer is enabled, stops script if not
    if [ $ZimFtpEnable = 'yes' ] || [ $ZimScpEnable = 'yes' ]
    then
     if [ ! -e /usr/bin/expect ]
      then
       echo "expect command is missing, this is required for file transfer options, script exiting..."
       exit
     fi
    fi
    
    # Create log file if not exist
    if [ $ZimLogEnable = 'yes' ]
     then
      touch $ZimBackupPath/$ZimLogFileName
    fi
    
    # Check to see if the tmp folder exist, and create if not
    mkdir -p $ZimTempPath
    
    # Check which zimbra version that is installed, for recovery purpose 
    sudo -u zimbra $ZimInstPath/$ZimHome/bin/zmcontrol -v > $ZimTempPath/zimbra_version.txt
    }
    
    full_backup() {
    if [ $ZimLogEnable = 'yes' ] && [ $ZimLogVerbose = 'yes' ]
     then
       # Removing possible old zimbra backup folder
       echo "`date +%Y%m%d%H%M%S` - Removing old backup folder from $ZimTempPath..." >> $ZimBackupPath/$ZimLogFileName
       rm -r -f $ZimTempPath/$ZimHome >> $ZimBackupPath/$ZimLogFileName
       echo "`date +%Y%m%d%H%M%S` - Removing old backup folder from $ZimTempPath done" >> $ZimBackupPath/$ZimLogFileName
    
       # Stopping Zimbra
       echo "`date +%Y%m%d%H%M%S` - Zimbra services stopping..." >> $ZimBackupPath/$ZimLogFileName
       /etc/init.d/zimbra stop >> $ZimBackupPath/$ZimLogFileName
       sleep 20
       echo "`date +%Y%m%d%H%M%S` - Zimbra services stopped." >> $ZimBackupPath/$ZimLogFileName
    
       # Backing up zimbra folder
       echo "`date +%Y%m%d%H%M%S` - Zimbra folder copying to backup..." >> $ZimBackupPath/$ZimLogFileName
       cp -rv $ZimInstPath/$ZimHome $ZimTempPath/ >> $ZimBackupPath/$ZimLogFileName
       echo "`date +%Y%m%d%H%M%S` - Zimbra folder copied to backup." >> $ZimBackupPath/$ZimLogFileName
    
       # Starting Zimbra
       echo "`date +%Y%m%d%H%M%S` - Zimbra services starting..." >> $ZimBackupPath/$ZimLogFileName
       /etc/init.d/zimbra start >> $ZimBackupPath/$ZimLogFileName
       echo "`date +%Y%m%d%H%M%S` - Zimbra services started." >> $ZimBackupPath/$ZimLogFileName
    
       # Compressing backup for space reduction
       echo "`date +%Y%m%d%H%M%S` - Compressing backup folder..." >> $ZimBackupPath/$ZimLogFileName
       tar -zcvf $ZimBackupPath/$ZimFilenameSystemFull -C $ZimTempPath $ZimHome zimbra_version.txt >> $ZimBackupPath/$ZimLogFileName
       echo "`date +%Y%m%d%H%M%S` - Compressed backup folder." >> $ZimBackupPath/$ZimLogFileName
     else
      # Removing possible old zimbra backup folder
      rm -r -f $ZimTempPath/$ZimHome
      # Stopping Zimbra
      /etc/init.d/zimbra stop
      sleep 20
      # Backing up zimbra folder
      cp -rv $ZimInstPath/$ZimHome $ZimTempPath/
      # Starting Zimbra
      /etc/init.d/zimbra start
      # Compressing backup for space reduction
      tar -zcvf $ZimBackupPath/$ZimFilenameSystemFull -C $ZimTempPath $ZimHome zimbra_version.txt
    fi
    }
    
    diff_backup() {
    if [ $ZimLogEnable = 'yes' ] && [ $ZimLogVerbose = 'yes' ]
     then
      # Hot sync before shutdown on zimbra folder
      echo "`date +%Y%m%d%H%M%S` - Hot syncing to backup folder..." >> $ZimBackupPath/$ZimLogFileName
      rsync -avHK --delete $ZimInstPath/$ZimHome $ZimTempPath/ >> $ZimBackupPath/$ZimLogFileName
      echo "`date +%Y%m%d%H%M%S` - Hot syncing to backup folder done." >> $ZimBackupPath/$ZimLogFileName
    
      # Stopping Zimbra
      echo "`date +%Y%m%d%H%M%S` - Zimbra services stopping..." >> $ZimBackupPath/$ZimLogFileName
      /etc/init.d/zimbra stop >> $ZimBackupPath/$ZimLogFileName >> $ZimBackupPath/$ZimLogFileName
      sleep 20
      echo "`date +%Y%m%d%H%M%S` - Zimbra services stopped." >> $ZimBackupPath/$ZimLogFileName
    
      # Cold sync of zimbra folder
      echo "`date +%Y%m%d%H%M%S` - Cold syncing to backup folder..." >> $ZimBackupPath/$ZimLogFileName
      rsync -avHK --delete $ZimInstPath/$ZimHome $ZimTempPath/ >> $ZimBackupPath/$ZimLogFileName
      echo "`date +%Y%m%d%H%M%S` - Cold syncing to backup folder done." >> $ZimBackupPath/$ZimLogFileName
    
      # Starting Zimbra
      echo "`date +%Y%m%d%H%M%S` - Zimbra services starting..." >> $ZimBackupPath/$ZimLogFileName
      /etc/init.d/zimbra start >> $ZimBackupPath/$ZimLogFileName
      echo "`date +%Y%m%d%H%M%S` - Zimbra services started." >> $ZimBackupPath/$ZimLogFileName
    
      # Compressing backup for space reduction and removing unpacked folder
      echo "`date +%Y%m%d%H%M%S` - Compressing backup folder..." >> $ZimBackupPath/$ZimLogFileName
      tar -zcvf $ZimBackupPath/$ZimFilenameSystemDiff -C $ZimTempPath $ZimHome zimbra_version.txt >> $ZimBackupPath/$ZimLogFileName
      echo "`date +%Y%m%d%H%M%S` - Compressed backup folder." >> $ZimBackupPath/$ZimLogFileName
     else
      # Hot sync before shutdown on zimbra folder
      rsync -avHK --delete $ZimInstPath/$ZimHome $ZimTempPath/
      # Stopping Zimbra
      /etc/init.d/zimbra stop >> $ZimBackupPath/$ZimLogFileName
      sleep 20
      # Cold sync of zimbra folder
      rsync -avHK --delete $ZimInstPath/$ZimHome $ZimTempPath/
      # Starting Zimbra
      /etc/init.d/zimbra start >> $ZimBackupPath/$ZimLogFileName
      # Compressing backup for space reduction and removing unpacked folder
      tar -zcvf $ZimBackupPath/$ZimFilenameSystemDiff -C $ZimTempPath $ZimHome zimbra_version.txt
    fi
    }
    
    msgfull_backup() {
    if [ $ZimLogEnable = 'yes' ] && [ $ZimLogVerbose = 'yes' ]
     then
      # Removing possible old store backup folder
      echo "`date +%Y%m%d%H%M%S` - Removing old backup folder from $ZimTempPath" >> $ZimBackupPath/$ZimLogFileName
      rm -r -f $ZimTempPath/store >> $ZimBackupPath/$ZimLogFileName
      echo "`date +%Y%m%d%H%M%S` - Removing old backup folder from $ZimTempPath done" >> $ZimBackupPath/$ZimLogFileName
    
      # Make dir for hot sync
      echo "`date +%Y%m%d%H%M%S` - Creating backup folder..." >> $ZimBackupPath/$ZimLogFileName
      mkdir -p $ZimTempPath/store >> $ZimBackupPath/$ZimLogFileName
      echo "`date +%Y%m%d%H%M%S` - Creating backup folder done." >> $ZimBackupPath/$ZimLogFileName
    
      # Hot sync of mailbox messages
      echo "`date +%Y%m%d%H%M%S` - Hot syncing to backup folder..." >> $ZimBackupPath/$ZimLogFileName
      rsync -avHK --delete $ZimInstPath/$ZimHome/store/0 $ZimTempPath/store/ >> $ZimBackupPath/$ZimLogFileName
      echo "`date +%Y%m%d%H%M%S` - Hot syncing to backup folder done." >> $ZimBackupPath/$ZimLogFileName
    
      # Compressing store folder for space reduction
      echo "`date +%Y%m%d%H%M%S` - Compressing backup folder..." >> $ZimBackupPath/$ZimLogFileName
      tar -zcvf $ZimBackupPath/$ZimFilenameMsgFull -C $ZimTempPath store zimbra_version.txt >> $ZimBackupPath/$ZimLogFileName
      echo "`date +%Y%m%d%H%M%S` - Compressed backup folder." >> $ZimBackupPath/$ZimLogFileName
     else
      # Removing possible old store backup folder
      rm -r -f $ZimTempPath/store
      # Make dir for hot sync
      mkdir -p $ZimTempPath/store
      # Hot sync of mailbox messages
      rsync -avHK --delete $ZimInstPath/$ZimHome/store/0 $ZimTempPath/store/
      # Compressing store folder for space reduction
      tar -zcvf $ZimBackupPath/$ZimFilenameMsgFull -C $ZimTempPath store zimbra_version.txt
    fi
    }
    
    msgdiff_backup() {
    if [ $ZimLogEnable = 'yes' ] && [ $ZimLogVerbose = 'yes' ]
     then
      # Make dir for hot sync
      echo "`date +%Y%m%d%H%M%S` - Creating backup folder..." >> $ZimBackupPath/$ZimLogFileName
      mkdir -p $ZimTempPath/store >> $ZimBackupPath/$ZimLogFileName
      echo "`date +%Y%m%d%H%M%S` - Creating backup folder done." >> $ZimBackupPath/$ZimLogFileName
    
      # Hot sync of mailbox messages
      echo "`date +%Y%m%d%H%M%S` - Hot syncing to backup folder..." >> $ZimBackupPath/$ZimLogFileName
      rsync -avHK --delete $ZimInstPath/$ZimHome/store/0 $ZimTempPath/store/ >> $ZimBackupPath/$ZimLogFileName
      echo "`date +%Y%m%d%H%M%S` - Hot syncing to backup folder done." >> $ZimBackupPath/$ZimLogFileName
    
      # Compressing store folder for space reduction
      echo "`date +%Y%m%d%H%M%S` - Compressing backup folder..." >> $ZimBackupPath/$ZimLogFileName
      tar -zcvf $ZimBackupPath/$ZimFilenameMsgDiff -C $ZimTempPath store zimbra_version.txt
      echo "`date +%Y%m%d%H%M%S` - Compressed backup folder." >> $ZimBackupPath/$ZimLogFileName
     else
      # Make dir for hot sync
      mkdir -p $ZimTempPath/store
      # Hot sync of mailbox messages
      rsync -avHK --delete $ZimInstPath/$ZimHome/store/0 $ZimTempPath/store/
      # Compressing store folder for space reduction
      tar -zcvf $ZimBackupPath/$ZimFilenameMsgDiff -C $ZimTempPath store zimbra_version.txt
    fi
    }
    
    file_transfer() {
    # Check which filename to use in file transfer
    if [ $ZimBackupType == "full" ]
    then
     ZimFilenameTransfer=$ZimFilenameSystemFull
    fi
    if [ $ZimBackupType == "diff" ]
    then
     ZimFilenameTransfer=$ZimFilenameSystemDiff
    fi
    if [ $ZimBackupType == "msgfull" ]
    then
     ZimFilenameTransfer=$ZimFilenameMsgFull
    fi
    if [ $ZimBackupType == "msgdiff" ]
    then
     ZimFilenameTransfer=$ZimFilenameMsgDiff
    fi
    
    # Transfer with ftp
    if [ $ZimFtpEnable == "yes" ]
    then
    if [ $ZimLogEnable = 'yes' ] && [ $ZimLogVerbose = 'yes' ]
     then
      echo "`date +%Y%m%d%H%M%S` - Sending file via ftp to offsite storage..." >> $ZimBackupPath/$ZimLogFileName
      # Make a temporary script for expect commands
      touch $ZimTempPath/ftp.exp
      # Fill script with commands
      echo '#!/usr/bin/expect --' >> $ZimTempPath/ftp.exp
      echo 'set timeout -1' >> $ZimTempPath/ftp.exp
      echo 'spawn ftp '$ZimFilehostAddress >> $ZimTempPath/ftp.exp
      echo 'expect ):' >> $ZimTempPath/ftp.exp
      echo 'send '$ZimFilehostUser'\r' >> $ZimTempPath/ftp.exp
      echo 'expect :' >> $ZimTempPath/ftp.exp
      echo 'send '$ZimFilehostPass'\r' >> $ZimTempPath/ftp.exp
      echo 'expect >' >> $ZimTempPath/ftp.exp
      echo 'send '$ZimFtpOpt'\r' >> $ZimTempPath/ftp.exp
      echo 'send "send '$ZimBackupPath/$ZimFilenameTransfer $ZimFilehostFolder/$ZimFilenameTransfer'\r"' >> $ZimTempPath/ftp.exp
      echo 'expect >' >> $ZimTempPath/ftp.exp
      echo 'send quit\r' >> $ZimTempPath/ftp.exp
      echo 'expect closed' >> $ZimTempPath/ftp.exp
      # Run expect with created script
      expect $ZimTempPath/ftp.exp  >> $ZimBackupPath/$ZimLogFileName
      # Delete temporary expect script
      rm $ZimTempPath/ftp.exp
      echo "`date +%Y%m%d%H%M%S` - Sending file via ftp to offsite storage done." >> $ZimBackupPath/$ZimLogFileName
     else
      # Make a temporary script for expect commands
      touch $ZimTempPath/ftp.exp
      # Fill script with commands
      echo '#!/usr/bin/expect --' >> $ZimTempPath/ftp.exp
      echo 'set timeout -1' >> $ZimTempPath/ftp.exp
      echo 'spawn ftp '$ZimFilehostAddress >> $ZimTempPath/ftp.exp
      echo 'expect ):' >> $ZimTempPath/ftp.exp
      echo 'send '$ZimFilehostUser'\r' >> $ZimTempPath/ftp.exp
      echo 'expect :' >> $ZimTempPath/ftp.exp
      echo 'send '$ZimFilehostPass'\r' >> $ZimTempPath/ftp.exp
      echo 'expect >' >> $ZimTempPath/ftp.exp
      echo 'send '$ZimFtpOpt'\r' >> $ZimTempPath/ftp.exp
      echo 'send "send '$ZimBackupPath/$ZimFilenameTransfer $ZimFilehostFolder/$ZimFilenameTransfer'\r"' >> $ZimTempPath/ftp.exp
      echo 'expect >' >> $ZimTempPath/ftp.exp
      echo 'send quit\r' >> $ZimTempPath/ftp.exp
      echo 'expect closed' >> $ZimTempPath/ftp.exp
      # Run expect with created script
      expect $ZimTempPath/ftp.exp
      # Delete temporary expect script
      rm $ZimTempPath/ftp.exp
    fi
    
    fi
    # Transfer with scp
    if [ $ZimScpEnable == "yes" ]
    then
     if [ $ZimLogEnable = 'yes' ] && [ $ZimLogVerbose = 'yes' ]
      then
       echo "`date +%Y%m%d%H%M%S` - Sending file via scp to offsite storage..." >> $ZimBackupPath/$ZimLogFileName
       # Make a temporary script for expect commands
       touch $ZimTempPath/scp.exp
       # Fill script with commands
       echo '#!/usr/bin/expect --' >> $ZimTempPath/scp.exp
       echo 'set timeout -1' >> $ZimTempPath/scp.exp
       echo 'spawn scp '$ZimScpOpt $ZimBackupPath/$ZimFilenameTransfer $ZimFilehostUser'@'$ZimFilehostAddress':'$ZimFilehostFolder >> $ZimTempPath/scp.exp
       echo 'expect :' >> $ZimTempPath/scp.exp
       echo 'send '$ZimFilehostPass'\r' >> $ZimTempPath/scp.exp
       echo 'expect closed' >> $ZimTempPath/scp.exp
       # Run expect with created script
       expect $ZimTempPath/scp.exp  >> $ZimBackupPath/$ZimLogFileName
       # Delete temporary expect script
       rm $ZimTempPath/scp.exp
       echo "`date +%Y%m%d%H%M%S` - Sending file via scp to offsite storage done." >> $ZimBackupPath/$ZimLogFileName
      else
       # Make a temporary script for expect commands
       touch $ZimTempPath/scp.exp
       # Fill script with commands
       echo '#!/usr/bin/expect --' >> $ZimTempPath/scp.exp
       echo 'set timeout -1' >> $ZimTempPath/scp.exp
       echo 'spawn scp '$ZimScpOpt $ZimBackupPath/$ZimFilenameTransfer $ZimFilehostUser'@'$ZimFilehostAddress':'$ZimFilehostFolder >> $ZimTempPath/scp.exp
       echo 'expect :' >> $ZimTempPath/scp.exp
       echo 'send '$ZimFilehostPass'\r' >> $ZimTempPath/scp.exp
       echo 'expect closed' >> $ZimTempPath/scp.exp
       # Run expect with created script
       expect $ZimTempPath/scp.exp
       # Delete temporary expect script
       rm $ZimTempPath/scp.exp
     fi
    fi
    
    # Remove local file(s) if ZimDeleteLocalFile is set to 'yes'
    if [ $ZimDeleteLocalFile == "yes" ]
    then
     if [ $ZimLogEnable = 'yes' ] && [ $ZimLogVerbose = 'yes' ]
      then
       echo "`date +%Y%m%d%H%M%S` - Deleting local file(s)..." >> $ZimBackupPath/$ZimLogFileName
       find $ZimBackupPath -maxdepth 1 -type f -mmin +$ZimDeleteTimeSet -name ZimBackup\*.tar.gz -exec rm {} +  >> $ZimBackupPath/$ZimLogFileName
       echo "`date +%Y%m%d%H%M%S` - Deleting local file(s) done." >> $ZimBackupPath/$ZimLogFileName
      else
       find $ZimBackupPath -maxdepth 1 -type f -mmin +$ZimDeleteTimeSet -name ZimBackup\*.tar.gz -exec rm {} +
     fi
    fi
    }
    
    log_start() {
    if [ $ZimLogEnable = 'yes' ]
     then
      echo "" >> $ZimBackupPath/$ZimLogFileName
      echo "-------------------------------------------------------" >> $ZimBackupPath/$ZimLogFileName
      echo "Backup Started: `date +%Y%m%d%H%M%S` Type: $ZimBackupType" >> $ZimBackupPath/$ZimLogFileName
    fi
    }
    
    log_end() {
    if [ $ZimLogEnable = 'yes' ]
     then
      echo "Backup Finished: `date +%Y%m%d%H%M%S` Type: $ZimBackupType" >> $ZimBackupPath/$ZimLogFileName
      echo "-------------------------------------------------------" >> $ZimBackupPath/$ZimLogFileName
    fi
    }
    
    case $1 in
    full)
    pre_check
    log_start
    full_backup
    file_transfer
    log_end
    ;;
    diff)
    pre_check
    log_start
    diff_backup
    file_transfer
    log_end
    ;;
    msgfull)
    pre_check
    log_start
    msgfull_backup
    file_transfer
    log_end
    ;;
    msgdiff)
    pre_check
    log_start
    msgdiff_backup
    file_transfer
    log_end
    ;;
    *)
    echo "Usage: ZimColdBackup.sh {full|diff|msgfull|msgdiff}"
    ;;
    esac

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

    Default

    Code:
    yum install expect

  8. #8
    ayush1440 is offline Loyal Member
    Join Date
    Apr 2008
    Location
    Ahmedabad, INDIA.
    Posts
    76
    Rep Power
    0

    Default

    Thanx a lot for your quick reply.

    Now its working. But one thing is, when ever backup archieve is created, old archieve is also exists. So there is a way to delete old archieve after creating new archieve?


    Again Thank you very much, it is really appreciated.

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

    Default

    You will either need to modify the script or setup a cronjob to do it. This is really not a issue for Zimbra as it is a community supplied script. You would be better contacting the author.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. zimbra install with perpetually broken logger/stats
    By jptech in forum Installation
    Replies: 8
    Last Post: 09-29-2008, 02:33 PM
  2. zmperditionctl start asking for password
    By k7sle in forum Administrators
    Replies: 32
    Last Post: 02-20-2008, 11:13 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. 4.5 Upgrade failure
    By brained in forum Installation
    Replies: 9
    Last Post: 03-03-2007, 03:30 PM
  5. Mail logs
    By Rick Baker in forum Installation
    Replies: 8
    Last Post: 01-17-2006, 04:33 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
  •