Page 64 of 66 FirstFirst ... 14546263646566 LastLast
Results 631 to 640 of 659

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

  1. #631
    Join Date
    Jan 2013
    Posts
    8
    Rep Power
    2

    Default

    That's exactly what I've done on my CentOS 6.x is to put sendmail on it and disable the service on startup.

  2. #632
    Join Date
    Apr 2013
    Location
    Pennsylvania
    Posts
    2
    Rep Power
    2

    Default

    Regarding Zimbra versions 8.0.2 and newer, here's a summary some of the information from around the forum regarding the changed backup requirement. I've included some specific command examples as well.

    The file /opt/zimbra/data/ldap/mdb/db/data.mdb is thinly provisioned (also called sparsely filled) as of version 8.0.2 - This means that the file will expand to approximately 80 GB if copied using standard commands such as cp. If you tar the file with compression, you won't find out about the issue until you attempt to restore (the file will expand to the full 80 GB upon decompression).

    You can verify the size characteristics of data.mdb with the following commands:

    ls -lha /opt/zimbra/data/ldap/mdb/db/
    Result: Fully provisioned size of the file.

    du -sh /opt/zimbra/data/ldap/mdb/db/data.mdb
    Result: Actual size of the file.

    df -h
    Result: Actual disk usage.

    As indicated earlier in this thread, you must modify the standard Open Source backup procedure as follows:

    1.) Copy the /opt/zimbra directory while excluding data.mdb
    2.) Perform a special copy operation for data.mdb

    For item 1, you can make use of an exclude flag. For item 2, you can use mdb_copy or zmslapcat. I've listed some example commands that will hopefully assist your understanding of how your backup script may change.

    Code:
    Notes:  The following bash script commands are for example purposes only.  
    They were tested on Ubuntu 10.04 LTS.  You can see both the mdb_copy as well 
    as the zmslapcat methods used here.  You only need one of them.  The zmslapcat
    method may throw a checksum error.  This is considered a poorly worded warning
    message and should not affect your export.
    
    zimbra_root_dir=/opt/zimbra            #zimbra root directory path
    backup_tmp_dir=/your/local/storage     #Local Storage - Preferably not /tmp
    
    mkdir $backup_tmp_dir
    mkdir $backup_tmp_dir/ldap-backup
    chgrp -R zimbra $backup_tmp_dir
    chmod -R 775 $backup_tmp_dir
    
    echo "Stopping zimbra at" $(date +"%Y-%m-%d %r")
    
    service zimbra stop          #stop the zimbra server
    
    $($zimbra_root_dir/openldap/bin/mdb_copy $zimbra_root_dir/data/ldap/mdb/db $backup_tmp_dir/ldap-backup)
    sudo -u zimbra $zimbra_root_dir/libexec/zmslapcat $backup_tmp_dir
    
    $(tar --exclude=/opt/zimbra/data/ldap/mdb/db/* -cpzf $backup_tmp_dir/$backup_tar_filename $zimbra_root_dir)
    
    service zimbra start         #start the zimbra server
    You must also modify the standard Open Source restore procedure as follows:

    1.) Perform a separate restore step for data.mdb

    Here are some example commands for both the mdb_copy and zmslapcat methods.

    Code:
    Notes:  Here are some example commands that work in the bash shell on 
    Ubuntu 10.04 LTS.  These commands would be used after you have successfully 
    restored all of the other zimbra files from backup.  You only need to use one set
    OR the other, NOT BOTH.
    
    #Command Set 1:  restoring ldap from a previous mdb_copy backup
    #Zimbra should be stopped.  You must change "/your/local/storage".
    #Once you've copied data.mdb with mdb_copy, you are free to move it around
    #using standard copy commands without it expanding to its fully provisioned size
    #up until the point that Zimbra accesses the file again.
    
    sudo cp /your/local/storage/ldap-backup/data.mdb /opt/zimbra/data/ldap/mdb/db
    sudo chown zimbra:zimbra /opt/zimbra/data/ldap/mdb/db/data.mdb
    sudo chmod 600 /opt/zimbra/data/ldap/mdb/db/data.mdb
    
    #Command Set 2:  restoring ldap from a previous zmslapcat backup
    #Zimbra should be stopped.  You must change "/your/local/storage".
    #The zimbra user will need permission to operate in the directory that the
    #ldap files are stored in from the backup process.
    #You must change "mail.yourserver.com" to the name of your mailserver.
    #You may see a checksum error during this method - this is considered a poorly
    #worded warning and should not affect your import.
    
    sudo chgrp zimbra /your/local/storage
    sudo chmod 775 /your/local/storage
    cd /your/local/storage
    su zimbra
    scp zimbra@mail.yourserver.com:/your/local/storage/ldap.bak /your/local/storage/ldap-provider.ldif
    /opt/zimbra/libexec/zmslapadd /your/local/storage/ldap-provider.ldif

  3. #633
    Join Date
    Dec 2011
    Posts
    14
    Rep Power
    3

    Default

    Hi All,

    After about a solid year of Running the backup script with a hitch, last night it failed with Zimbra user should never be root! I restarted zimbra (sudo su zimbra && zmcontrol restart) and checked the zimbra user... I'm still root. Can someone shed some light on what could have happened... please remember, I know just enough to be very dangerous... I'm still a noob.

    Thank you all!

  4. #634
    Join Date
    Oct 2013
    Posts
    1
    Rep Power
    2

    Default

    It seems that Zimbra have done something to the 8.0.5 version, specifically to the data.mdb file as now rsync --exclude command doesn't seem to work and where before I had no issues it seems to be including this file in the hot sync backup meaning I am running out of space on my 60gb SSD

  5. #635
    Join Date
    Nov 2013
    Posts
    1
    Rep Power
    1

    Default

    rsync need -S option to handle this file efficiently

  6. #636
    Join Date
    Sep 2011
    Posts
    256
    Rep Power
    4

    Default

    see mdb_copy to copy .mdb files

  7. #637
    Join Date
    Jan 2010
    Location
    Taipei, Taiwan
    Posts
    11
    Rep Power
    5

    Default

    I had something very strange recently on my 7.2.5 server: my zimbra crontab disappeared regularly.

    What happened is that when this script stops Zimbra, if there is an error, the script is stopped.

    And before stopping Zimbra, the script disables zimbra cron. So if like me you have an errror message when stopping Zimbra, then you have no backup, and your cron file is gone.

    I thought this experience could be useful to someone.

    Cheers,

    JPascal.

  8. #638
    Join Date
    Sep 2011
    Posts
    256
    Rep Power
    4

    Default

    Run

    crontab -u zimbra /tmp/crontab.zimbra

  9. #639
    Join Date
    Jan 2010
    Location
    Taipei, Taiwan
    Posts
    11
    Rep Power
    5

    Default

    Thanks Blason.

    Actually the crontab file is saved by the backup script in /opt/zimbra as crontab.org

    So you can also try: crontab -u zimbra /opt/zimbra/crontab.org

  10. #640
    Join Date
    Sep 2012
    Posts
    7
    Rep Power
    3

    Exclamation Fixed versions

    Hello!

    I use this script about 1 year and meet with some troubles.
    I fixed it so you can look at it.

    Fixed:
    1. restoring zimbra's crontab in case of errors (in some cases script did not restore it)
    2. manage collecting week backups in TO_MEDIA_DIR - you can switch it on or off
    3. added exclusion of MDB files in rsync option and copying of MDB files using mdb_copy

    TO DO:
    1. create backups of Zimbra from snapshot of LVM volume with Zimbra - it do not need hot an cold rsync passes - lesser Zimbra's downtime
    2. using of external conf file to simply replace script to newer version without need to edit settings in it

    Please let me know if you find something wrong.

    zmbak_v.0.8.1.sh.txt

Similar Threads

  1. Zimbra Backup Script ... Small Problem
    By frankb in forum Administrators
    Replies: 12
    Last Post: 07-14-2008, 09: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, 10:36 AM
  5. [SOLVED] Simple backup question...
    By dameron in forum Administrators
    Replies: 3
    Last Post: 08-25-2007, 10: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
  •