Page 16 of 22 FirstFirst ... 61415161718 ... LastLast
Results 151 to 160 of 211

Thread: Full Server Backup and Restore of “open source version”

  1. #151
    Join Date
    Jan 2007
    Posts
    14
    Rep Power
    8

    Default zimbrahotbackup.pl problem

    hello we had a problem with zimbrahotbackup.pl (posted by Chintan Zaveri)

    /opt/zimbra/backup/zimbrabackup.pl --confirm


    IO::Socket::INET: connect: Connection refused at /opt/zimbra/backup/zimbrabackup.pl line 163, <DATA> line 225.


    can anyone help me?

    thanks

  2. #152
    Join Date
    Feb 2006
    Location
    Pune, India
    Posts
    294
    Rep Power
    9

    Default

    Quote Originally Posted by Softec View Post
    hello we had a problem with zimbrahotbackup.pl (posted by Chintan Zaveri)

    /opt/zimbra/backup/zimbrabackup.pl --confirm


    IO::Socket::INET: connect: Connection refused at /opt/zimbra/backup/zimbrabackup.pl line 163, <DATA> line 225.


    can anyone help me?

    thanks
    Dear Softec,

    You are right. It doesn't work. That script is supposed to present a strategy which may possibly help further on, after some or many improvements/corrections, to develop a semi-hot-backup program for Zimbra Open Source.

    "marcmac" has remarked on it in the immediate next post.

    I have noticed, though, that the Cold Backup script which followed up a little later, works!
    Regards,

    Chintan Zaveri
    (Yet another ZIMBRAN!)

    "Dhundhne par Bhagwan bhi ..."

  3. #153
    Join Date
    Sep 2005
    Location
    Somewhere south of the border at this point... nice and sunny
    Posts
    47
    Rep Power
    10

    Default

    I finally worked out a lot of kinks in the script i had for backups that I mentioned elsewhere on the forum. this should make sense to everyone, hopefully.

    As a point of reference, i backed up the zimbra install, store and index in about 5 minutes - 1.6GB of mail, 60MB of index, 1.8GB in the zimbra install. here's the script, have fun! remember to toss it off to tape later on:

    Code:
    #! /bin/bash
    
    # Script to backup zimbra offline
    # Written by Rodolfo @ Jan. 21, 2007
    
    # Variable Declaration - all these variables should be modified to fit the environment
    
    BAKLOC=/opt/zmbackups                                                   # where backups should go
    
    ZMPATH=/opt/zimbra/bin                                                  # where your zimbra bin/ path is. Standard zimbra installations will have them here
    ZMSTATUS="zmcontrol status"
    ZMSTART="zmcontrol start"
    ZMSTOP="zmcontrol stop"
    
    ZMCORE=/opt/zimbra                                                      # Zimbra main directory
    ZMINDEX=/Volumes/SigilMail/zimbraindex                                  # Where your zimbra index is located
    ZMMAIL=/Volumes/SigilMail/zimbrastore                                   # Where your zimbra mailstore is located
    
    ZMBAKCORE=zmbackup-core-`date +%m%d%y`.tar
    ZMBAKMAIL=zmbackup-mail-`date +%m%d%y`.tar
    ZMBAKINDEX=zmbackup-index-`date +%m%d%y`.tar
    
    # Exit status is being presetted to 0. Each function will check if EXITSTATUS was modified. exit_status function will determine what EXITSTATUS means
    EXITSTATUS=0
    
    # Mark script's start time expressed in seconds since epoch
    
    function start_time {
    STARTTIME=`date +%s`
    echo $STARTTIME >> $BAKLOC/$LOGFILE
    }
    
    # Mark script's end time expressed in seconds since epoch
    
    function end_time {
    ENDTIME=`date +%s`
    echo $ENDTIME >> $BAKLOC/$LOGFILE
    }
    
    # Calculate how long the script took
    
    function calculate_time {
    CALTIME=0
    CALTIME=$ENDTIME - $STARTTIME
    echo "$CALTIME" >> $BAKLOC/$LOGFILE
    }
    
    # Creating log for this script. If log for TODAY already exists, quit with errno 10.
    
    function log_create {
    LOGFILE=zmbackup-log-`date +%m%d%y`.log
    if [ -e "$BAKLOC/$LOGFILE" ]; then
                    EXITSTATUS=10;                                          # exit 10 errno status: log for TODAY already exists. Check the clock
            else
                    touch "$BAKLOC/$LOGFILE"
                    start_time
                    EXITSTATUS=0
    fi
    exit_status
    }
    
    # Header for log file - file name, today's date with time
    
    function header {
    TODAY=`date`
    echo "File: $LOGFILE" >> $BAKLOC/$LOGFILE
    echo "Date: $TODAY" >> $BAKLOC/$LOGFILE
    EXITSTATUS=0
    exit_status
    }
    
    # Shut down Zimbra
    
    function shutdown_zimbra {
    sudo -u zimbra $ZMPATH/$ZMSTOP
    sudo -u zimbra $ZMPATH/$ZMSTATUS >> $BAKLOC/$LOGFILE                    # Confirm that Zimbra processes are not running
    EXITSTATUS=0
    exit_status
    }
    
    #Start up Zimbra
    
    function startup_zimbra {
    sudo -u zimbra $ZMPATH/$ZMSTART
    sudo -u zimbra $ZMPATH/$ZMSTATUS >> $BAKLOC/$LOGFILE                    # Cofirm that Zimbra process are running correctly
    EXITSTATUS=0
    exit_status
    }
    
    # Performing backup. Tar /opt/zimbra, /Volumes/SigilMail/zimbrastore and /Volumes/SigilMail/zimbraindex
    
    function execute_backup {
    echo "Backing up Zimbra @ $ZMCORE" >> $BAKLOC/$LOGFILE
    tar cvf $BAKLOC/$ZMBAKCORE $ZMCORE >> $BAKLOC/$LOGFILE
    echo "Backing up Zimbra $ZMMAIL" >> $BAKLOC/$LOGFILE
    tar cvf $BAKLOC/$ZMBAKMAIL $ZMMAIL >> $BAKLOC/$LOGFILE
    echo "Backing up Zimbra $ZMINDEX" >> $BAKLOC/$LOGFILE
    tar cvf $BAKLOC/$ZMBAKINDEX $ZMINDEX >> $BAKLOC/$LOGFILE
    EXITSTATUS=0
    exit_status
    }
    
    # Test exit status for errors
    
    function exit_status {
    case "$EXITSTATUS" in
            '0')
                    echo "errno $EXITSTATUS: Exit successful - no errors in script." >> $BAKLOC/$LOGFILE
            ;;
            '10')
                    echo "errno $EXITSTATUS: log for TODAY already exists. Check the system clock." >> $BAKLOC/$LOGFILE
                    exit 0
            ;;
    esac
    }
    
    # Execute functions correctly
    
    log_create
    header
    shutdown_zimbra
    execute_backup
    startup_zimbra
    end_time
    calculate_time
    
    # Exit script cleanly
    
    exit 0
    the script should be run as root or stuffed into a cronjob as root (hence the sudo lines). it's "very verbose" right now, but you can modify that by taking out the "v" option from the tar lines. time is expressed in seconds, which is fine with me, but you can modify the calculate_time function to divide by 60 if you want minutes or divide by 3600 for hours (if your backup takes that long).

    if you're going to restore using this script, remember that you have to run zmsetup.pl in /opt/zimbra/libexec as root to finish configuring the system. if any of the zimbra guys want to take this script and include it with the distro, no problem. adding the line to crontab should be simple.

    any questions, let me know.
    Last edited by segleaur; 04-21-2007 at 04:37 PM. Reason: added info
    cheers,

    rodolfo

  4. #154
    Join Date
    Sep 2005
    Location
    Buffalo, NY
    Posts
    65
    Rep Power
    10

    Talking Reiterating: Testing for disaster planning

    Just looking for verification -- baised on what robbyt said:

    if you want to make a simple backup, just to insure that your upgrade goes smooth, do this:

    /etc/init.d/zimbra stop
    ps aux |grep zimbra (to make sure zimbra is fully closed)
    cp -av /opt/zimbra /opt/zimbra.backup

    then run the upgrade-
    if things get hosed, all you should have to do is replace /opt/zimbra with /opt/zimbra.backup

    e.g.
    /etc/init.d/zimbra stop
    mv /opt/zimbra /opt/zimbra.hosed
    mv /opt/zimbra.backup /opt/zimbra
    /etc/init.d/zimbra start


    now, there are other things that the zimbra installer touches outside of /opt/zimbra, like for example cron and init scripts... so this might not be a 100% fix, but it's better then having a hosed email server
    if I do as he suggested, then burn the backed up /opt to DVD or tape,
    and then on another duplicate system (for testing purposes)
    Which of these options is the correct way to RESTORE this info:

    1. Install the same version of OS, then restore the /opt folder

    2. Install the same version of OS, then Install same version of Zimbra, then REPLACE the /opt folder over the installed zimbra

    3. Install the same version of OS, then Install same version of Zimbra, then copy the /opt folder over the installed zimbra

    ?!

    Gabe

  5. #155
    Join Date
    Feb 2006
    Location
    Pune, India
    Posts
    294
    Rep Power
    9

    Default

    Quote Originally Posted by gfdos.sys View Post
    Just looking for verification -- baised on what robbyt said:

    if I do as he suggested, then burn the backed up /opt to DVD or tape,
    and then on another duplicate system (for testing purposes)
    Which of these options is the correct way to RESTORE this info:

    1. Install the same version of OS, then restore the /opt folder

    2. Install the same version of OS, then Install same version of Zimbra, then REPLACE the /opt folder over the installed zimbra

    3. Install the same version of OS, then Install same version of Zimbra, then copy the /opt folder over the installed zimbra

    ?!

    Gabe
    Add to the 3rd option: IP Address of system, hostname of system, ...

    So, something like:

    Install the same version of OS on a system, install same version of ZCS, stop ZCS, make sure no ZCS processes are running, replace /opt/zimbra with the backed up version of /opt/zimbra (don't forget the symlinks, permissions, ownerships, ...), start zimbra
    Last edited by czaveri; 04-26-2007 at 11:33 PM. Reason: more info
    Regards,

    Chintan Zaveri
    (Yet another ZIMBRAN!)

    "Dhundhne par Bhagwan bhi ..."

  6. #156
    Join Date
    Nov 2006
    Posts
    7
    Rep Power
    8

    Default ZimbraColdBackup

    Hi Czaveri

    I have been using your zimbracoldbackup script for about 3 months and it 's great. Do you have any plan to work on the e-mail issue for he log and also any idea to add rotation (daily -weekly - monthly) would be great
    than you

  7. #157
    Join Date
    Feb 2006
    Location
    Pune, India
    Posts
    294
    Rep Power
    9

    Default

    Quote Originally Posted by jahaj View Post
    Hi Czaveri

    I have been using your zimbracoldbackup script for about 3 months and it 's great. Do you have any plan to work on the e-mail issue for he log and also any idea to add rotation (daily -weekly - monthly) would be great
    than you
    Hi jahaj,

    Thank-you for the kind words.

    Geoff liked it, too, and had a few ideas and improvements - he will be taking this further.

    You can communicate with him at http://sourceforge.net/projects/zcstools/
    Regards,

    Chintan Zaveri
    (Yet another ZIMBRAN!)

    "Dhundhne par Bhagwan bhi ..."

  8. #158
    Join Date
    Sep 2006
    Location
    Seattle, WA
    Posts
    45
    Rep Power
    9

    Default rsync user

    Just started using the zimbracoldbackup script and I love it. I'm running into one problem though, I've got it set to rsync the backup to another server, but it always wants to connect as root and I don't have access to root on the backup server. I've grepped through the script a bit, but I don't see a variable to set my rsync user. Am I just being dense, is there a way to set the user?

  9. #159
    Join Date
    Feb 2006
    Location
    Pune, India
    Posts
    294
    Rep Power
    9

    Default

    Quote Originally Posted by jahaj View Post
    Hi Czaveri

    I have been using your zimbracoldbackup script for about 3 months and it 's great. Do you have any plan to work on the e-mail issue for he log and also any idea to add rotation (daily -weekly - monthly) would be great
    than you

    jahaj,

    The script emails you after backup with information such as, how long it took to backup and what is the path to the new backup. It also has a feature to rotate backups. You need to specify this in number of days.
    Regards,

    Chintan Zaveri
    (Yet another ZIMBRAN!)

    "Dhundhne par Bhagwan bhi ..."

  10. #160
    Join Date
    Sep 2006
    Location
    Seattle, WA
    Posts
    45
    Rep Power
    9

    Default

    Code:
    my $ssh_server  = 'host.domain.com'; # SSH server IP or hostname
    to user@host.domain.com?

    Gave that a try, but it still wants to login as root
    Last edited by mmorse; 11-18-2007 at 09:02 PM.

Similar Threads

  1. mailbox backup & restore on open source version
    By Artturi in forum Administrators
    Replies: 3
    Last Post: 07-30-2010, 04:26 PM
  2. Restore single account failed from full backup
    By fmodola in forum Administrators
    Replies: 4
    Last Post: 06-20-2007, 05:27 AM
  3. 3 testing: LDAP: 389 Failed when restore zimbra
    By victorLeong in forum Administrators
    Replies: 15
    Last Post: 05-24-2007, 06:45 AM
  4. copying only last full backup to store offsite
    By riccadus in forum Administrators
    Replies: 0
    Last Post: 01-11-2007, 12:29 AM
  5. Zimbra Full Backup and Restore???
    By jgao in forum Administrators
    Replies: 3
    Last Post: 01-19-2006, 12:34 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
  •