Page 47 of 66 FirstFirst ... 37454647484957 ... LastLast
Results 461 to 470 of 659

Thread: [SOLVED] Yet Another Backup Script for Community Version

  1. #461
    ramjimh is offline Active Member
    Join Date
    Jul 2008
    Posts
    42
    Rep Power
    7

    Default Zimbra open source backup for redhat

    Quote Originally Posted by heinzg View Post
    Hi

    Added a Redhat compatible version on the download site, for now. Till the next release is out where all distros should be compatible (I hope).

    Cheers
    heinzg

    P.S. thank you for your feed back!
    where can i get this script.If available kindly send me to ramjimh@gmail.com

    with regards,

    ramji

  2. #462
    gvillaran is offline Loyal Member
    Join Date
    Feb 2008
    Location
    Peru
    Posts
    94
    Rep Power
    7

    Smile

    Nice script, working really well, i only need to know a former restore method now, if anyone have the instructions on how to do it i will appreciate the information.

    Again thanks for the effort on this, is really a good work guys

  3. #463
    Koffie is offline Active Member
    Join Date
    Sep 2010
    Posts
    30
    Rep Power
    4

    Default zmDBbac.sh PLEASE HELP

    PLEASE HELP!!

    I'm having SERIOUS trouble trying to get the zmDBbac.sh script to work, please have a look at the error
    Code:
    Had to kill some left over procs...
    Doing a fast cold sync...
    
    Creating db_dumps directory...
    Backing up Zimbra DBs...
    -su: SYNC_DIR: command not found
    There was an error running DB backup script! Aborting DB backup. Continuing main backup
    Reinstating Zimbra's crontab...
    Starting Zimbra...
    Host xxx.xxx.xxx
    	Starting ldap...
    Required variable not set!
    Required variable: SYNC_DIR OR makeraw
    Usage:
    Backup:	       /path/to/zmDBbac.sh /path/to/sync/dir OR
    Raw converson: /path/to/zmDBbac.sh makeraw db.sql db-raw.sql
    
    Done.
    Please tell me that I am just being a n00b and not setting a variable somewhere, I have had a look but can't seem to find where it needs to be set.

    Thanks in advance!

    EDIT:!!!!

    NEVER MIND, I made a syntax error, & instead of $

    It is all working now

    Thanks for the script LaFong!
    Last edited by Koffie; 04-07-2011 at 06:31 AM.

  4. #464
    LaFong is offline Advanced Member
    Join Date
    Nov 2008
    Location
    Denver, CO
    Posts
    221
    Rep Power
    6

    Default

    Quote Originally Posted by gvillaran View Post
    Nice script, working really well, i only need to know a former restore method now, if anyone have the instructions on how to do it i will appreciate the information.
    General restore:
    [SOLVED] Yet Another Backup Script for Community Version

    Open Source Edition Backup Procedure - Zimbra :: Wiki

    These instructions do not cover how to extract dar files, if that's what you're using. For those, you restore the full first, then all the diffs to the same location, in order from earliest to last. You usually would not restore to your current Zimbra path, but to a temporary location. Then use the general restoring instructions from the wiki. I may write a little script to automate restoring dars.

    Not part of the main script is more granular backup/restore:
    User restore:
    [SOLVED] Yet Another Backup Script for Community Version

    Single folder restore:
    [SOLVED] Yet Another Backup Script for Community Version

  5. #465
    gvillaran is offline Loyal Member
    Join Date
    Feb 2008
    Location
    Peru
    Posts
    94
    Rep Power
    7

    Default

    Thanks LaFong, yeah im using the DAR method but i never worked with dar files before.

    so i looked in google for how to work with dar files and found it, but im getting errors while i
    try to list the content, the program ask me for a file that i cant find anywhere, i will read
    more about dar files today.

    Would be really great to have a script to restore from dar method.

    Thanks for your help and nice work
    Last edited by gvillaran; 04-11-2011 at 05:59 PM.

  6. #466
    LaFong is offline Advanced Member
    Join Date
    Nov 2008
    Location
    Denver, CO
    Posts
    221
    Rep Power
    6

    Default

    Quote Originally Posted by gvillaran View Post
    Thanks LaFong, yeah im using the DAR method but i never worked with dar files before.

    so i looked in google for how to work with dar files and found it, but im getting errors while i try to list the content, the program ask me for a file
    Typically, it's because you don't use the full file name, just the "basename". So if a file is named "15_ZimbraBackup_20110411_FULL.1.dar" and you want to see its contents, leave out the last two fields (.1.dar).
    Code:
    [root@mail /]# dar -l 15_ZimbraBackup_20110411_FULL
    Would be really great to have a script to restore from dar method.
    Here you go. The usual disclaimers apply: I have not tested thoroughly, it is offered as-is, no warranties are implied or apply.
    Code:
    #!/bin/bash
    # Script to extract a set of Zimbra FULL and DIFF dar files to a destination directory.
    # Run the script with no parameters to get usage information.
    
    DAR_BIN=`whereis dar | awk '{print $2}'`
    if [ -n "$2" ] ; then
       DAR_DIR=`echo $1 | sed 's/\/$//'`
       DEST_DIR="$2"
       FULL_FILE=`ls "$DAR_DIR"/* | grep FULL | grep dar$`
       if [ -n "$FULL_FILE" ] ; then
          if [ ! -d "$DEST_DIR" ] ; then
            echo
            printf "$DEST_DIR does not exist. Would you like it to be created? (y or n): "
            read answer
            case $answer in
               y|Y)
                   mkdir "$DEST_DIR"
                   if [ "$?" -ne "0" ] ; then
                      echo "Error creating destination directory, aborting. Check your destination path."
                      exit 1
                   fi
                 ;;
                 *)
                   echo "No directory available to extract files to, aborting script."
                   exit 1
                 ;;
            esac
          fi
          FULL=`echo ${FULL_FILE%.*.*}`
          echo "FULL is $FULL"
          $DAR_BIN -x "$FULL" -w -R "$DEST_DIR"
       else
          echo "No FULL file in the DAR directory, aborting!"
          exit 1
       fi
       DIFF_FILE=`ls -tr "$DAR_DIR"/* | grep DIFF | grep dar$ | tail -1`
       if [ -n "$DIFF_FILE" ] ; then
          DIFF=`echo ${DIFF_FILE%.*.*}`
          echo "Diff file is $DIFF"
          $DAR_BIN -x "$DIFF" -wa -R "$DEST_DIR"
       fi
       echo "All done."
    else
       printf "\n\n"
       echo 'Not enough parameters.
    
    Usage: SCRIPT_PATH DAR_DIR DEST_DIR
    
    Where SCRIPT_PATH is the path to this script, DAR_DIR is the full path to your dar files,
    and DEST_DIR is the full path to the place where you want to put the restored data.
    For example:
    
    /usr/local/sbin/zmDARrestore.sh /Backup/zimbra_dars /mnt/restore/zimbra
    
    THINGS TO NOTE:
         * The parent path in DEST_DIR must already exist. For example, using a DEST_DIR of /mnt/restore/zimbra, /mnt/restore must already exist.
          (The restore could be many GB, so we want to be sure that the path (mount point) has enough room.)
         * Be SURE you have enough room in DEST_DIR for your restored files. Avoid restoring to the / partition.
         * The script will create the DEST_DIR for you if it does not exist, and you have write permission.
         * Be careful where you restore Zimbra, the DEST_DIR. You do NOT want to restore to /opt/zimbra if that directory already exists.
         * It assumes you have only one FULL, and one DIFF for that FULL, in the DAR_DIR. Move files as necessary to meet this precondition.
           Move the DIFF you want to use, in order to restore to a specific date. Usually, though, you would use the latest DIFF. If there is
           more than one DIFF in the DAR_DIR, it will use the latest one.
         * It assumes you use the default $FULL_PREFIX ("FULL") and $DIFF_PREFIX ("DIFF").'
    printf "\n\n\n"
    fi
    Here are the THINGS TO NOTE from the script usage section:
    • The parent path in DEST_DIR must already exist. For example, using a DEST_DIR of /mnt/restore/zimbra, /mnt/restore must already exist.
      (The restore could be many GB, so we want to be sure that the path (mount point) has enough room.)
    • Be SURE you have enough room in DEST_DIR for your restored files. Avoid restoring to the / partition.
    • The script will create the DEST_DIR for you if it does not exist, and you have write permission.
    • Be careful where you restore Zimbra, the DEST_DIR. You do NOT want to restore to /opt/zimbra if that directory already exists.
    • It assumes you have only one FULL, and one DIFF for that FULL, in the DAR_DIR. Move files as necessary to meet this precondition. Move only the DIFF you
      want to use, in order to restore to a specific date. Usually, though, you would use the latest DIFF. If there is more than one DIFF in the DAR_DIR, it will use the
      latest one.
    • It assumes you use the default $FULL_PREFIX ("FULL") and $DIFF_PREFIX ("DIFF").'
    Last edited by LaFong; 04-12-2011 at 02:24 PM.

  7. #467
    gvillaran is offline Loyal Member
    Join Date
    Feb 2008
    Location
    Peru
    Posts
    94
    Rep Power
    7

    Default

    Thats great Lafong....i tested the script today, the full backup was restored fine with no warnings.....but when restoring de diff's the program started to ask me this :

    /tmp/restore/store/0/11/msg/0/1040-1703.msg must be removed, but does not match expected type, remove it anyway ? [return = OK | Esc = cancel]
    Continuing...

    that was like 20 times.....i just hit return for testing purposes and the script ended.

    i guess something is wrong with the diff process?

    Thank you very much for your effort.

  8. #468
    Lallo is offline Member
    Join Date
    Oct 2010
    Posts
    11
    Rep Power
    4

    Default Long Backup Time?

    Hello,
    i'm trying to understand what is the bottleneck of this backup procedure.

    In the log I have output like these:
    ...
    "Service down time was - Hr:0 Min:6 Sec:3"
    ...
    full Zimbra Backup ended at: 17:29
    Backup took Hr:15 Min:59 Sec:54 to complete

    Since I'm using DRCP to copy the DAR on another server I was thinking that the ssh transfer time was the main reason for the long backup (I was blaming poor networking). I'm not so sure anymore therefore I've put some echo "now is `date`" in the script to better investigate.

    In your experience how long does the full backup procedure take and what is the bottleneck? I obviously can't imagine what would happen if another instance of this script is started before the other has ended.

  9. #469
    LaFong is offline Advanced Member
    Join Date
    Nov 2008
    Location
    Denver, CO
    Posts
    221
    Rep Power
    6

    Default

    Quote Originally Posted by gvillaran View Post
    Thats great Lafong....i tested the script today, the full backup was restored fine with no warnings.....but when restoring de diff's the program started to ask me this :

    /tmp/restore/store/0/11/msg/0/1040-1703.msg must be removed, but does not match expected type, remove it anyway ? [return = OK | Esc = cancel]
    Continuing...

    that was like 20 times.....i just hit return for testing purposes and the script ended.

    i guess something is wrong with the diff process?
    Ugh. Yes. Sorry. I forgot that the main script does a complete diff every time, not an incremental one. So, every diff is based off the full and, if you have at least one diff, you only need the full dar and one diff in order to restore. That diff will usually be latest diff for that particular full. I changed the script to reflect that. These facts also make manual restore much easier:
    For a full named 15_ZimbraBackup_20110411_FULL.1.dar and latest diff named 15_ZimbraBackup_20110414_DIFF.1.dar and
    Code:
    dar -x /Backup/Zimbra_dars/15_ZimbraBackup_20110411_FULL -w -R /mnt/restore
    dar -x /Backup/Zimbra_dars/15_ZimbraBackup_20110414_DIFF -w -R /mnt/restore
    You must always use a diff which is based off the full.

  10. #470
    gvillaran is offline Loyal Member
    Join Date
    Feb 2008
    Location
    Peru
    Posts
    94
    Rep Power
    7

    Default

    oh aright, can u post the script again? with the corrections, so i can go and test it again?

    Thanks

Page 47 of 66 FirstFirst ... 37454647484957 ... LastLast

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Zimbra Backup Script ... Small Problem
    By frankb in forum Administrators
    Replies: 12
    Last Post: 07-14-2008, 08:40 AM
  2. Debian - Upgrade from 4.5.6
    By magikman in forum Installation
    Replies: 1
    Last Post: 01-19-2008, 12:59 PM
  3. Backup script issues
    By SSS in forum Administrators
    Replies: 18
    Last Post: 12-03-2007, 09:56 AM
  4. 4.0.4 to 4.5.6 upgrade failed in network edition
    By chenthil in forum Administrators
    Replies: 1
    Last Post: 08-27-2007, 09:36 AM
  5. [SOLVED] Simple backup question...
    By dameron in forum Administrators
    Replies: 3
    Last Post: 08-25-2007, 09:36 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
  •