Page 52 of 66 FirstFirst ... 242505152535462 ... LastLast
Results 511 to 520 of 659

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

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

    Default

    Quote Originally Posted by aarat View Post
    The fake backup is happening on SATA Storage (IBM DS3500) Virtualized on Xenserver. However the dars are being created on cifs share mounted on NAS with 100mbps of LAN Connectivity to server.
    CIFS isn't the fastest protocol, and 100mbps is meh, but the speed of dar'ing is the probably the biggest speed factor. The mail server is fully functional while dar'ing, so it's not ordinarily a problem.
    I am also not receving mail for backup as it ends up with /usr/lib/sendmail not found.
    I don't know which distro you are using, Don't forget to update your profile with version info, but it seems you do not have sendmail installed. The 'mail' command uses sendmail, usually. Add a softlink pointing to Zimbra sendmail:
    Code:
    ln -s /opt/zimbra/postfix/sbin/sendmail /usr/lib/sendmail
    Or, you can probably just install sendmail, but make sure it is not enabled. You don't want it competing with Zimbra postfix.
    Or, if using a Debian/Ubuntu derivative, you might alter /etc/nail.rc: [SOLVED] Yet Another Backup Script for Community Version

    Here's the backup log============================
    Sat Jan 14 00:41:52 IST 2012
    Performing FULL backup
    ============================
    full Backup started at: Sat Jan 14 00:41:52 IST 2012
    Setting date & version Marker into /opt/zimbra/DATE_VERSION.txt
    Doing a hotsync of /opt/zimbra/ to /opt/fakebackup/
    rsync: stat "/opt/fakebackup/store/0/111/msg/1/.4154-3372.msg.83CGcp" failed: No such file or directory (2)
    rsync: rename "/opt/fakebackup/store/0/111/msg/1/.4154-3372.msg.83CGcp" -> "store/0/111/msg/1/4154-3372.msg": No such file or directory (2)
    rsync: link "/opt/fakebackup/store/0/118/msg/0/260-14.msg" => store/0/106/msg/0/279-52.msg failed: File exists (17)
    These are normal rsync errors, which you are more likely to see with the first full rsync.

    Creating MD5 Checksum for 02_ZimbraBackup_20120114_FULL.10.dar...
    Creating MD5 Checksum for 02_ZimbraBackup_20120114_FULL.11.dar...
    Creating MD5 Checksum for 02_ZimbraBackup_20120114_FULL.12.dar...
    Creating MD5 Checksum for 02_ZimbraBackup_20120114_FULL.13.dar...
    Creating MD5 Checksum for 02_ZimbraBackup_20120114_FULL.14.dar...
    I'm not a fan of a whole bunch of dar files for individual backups. This happens because the default size of the ARCHIVESIZE variable by default is only 4GB. This was originally to fit individual dars on DVD, but almost no one does that. I would set it much larger. e.g.
    Code:
    ARCHIVESIZE="310000M"
    If you don't want a single dar to be 300GB, I would still set it much larger than 4GB.
    Last edited by LaFong; 01-15-2012 at 12:39 AM.

  2. #512
    aarat is offline Active Member
    Join Date
    Aug 2011
    Posts
    32
    Rep Power
    3

    Default

    Mail problem got resolved by adding the line in nail.rc however When doing differnetial backup I am getting this error

    Writing a diff backup: 02_ZimbraBackup_20120115_DIFF
    into: /Backup/zimbra_dars/ with file sizes of max: 4395M
    Saving Unencrtyped Archive...
    Aborting program. User refused to continue while asking: /Backup/zimbra_dars/02_ZimbraBackup_20120111_FULL
    /Backup/zimbra_dars/02_ZimbraBackup_20120114_FULL.1.dar is required for further operation, please provide the file.
    Dar had a problem!
    Zimbra Version 8.0.1_G.A._5438 (build 20121105164416) running on ubuntu 10.04 x64

  3. #513
    kazooless is offline Loyal Member
    Join Date
    Mar 2009
    Posts
    91
    Rep Power
    6

    Default Failure Each Night

    I just started getting this error almost every night. One night in 5 it didn't occur and a DIFF is what was scheduled for each of them. I don't think they type has anything to do with it though based on the error message. I am wondering if I might have some corruption in the mailbox? Here is a clip from the logs. What do you think? (The log failure is the same each night)

    ============================
    Sun Jan 15 01:05:03 PST 2012
    Performing DIFF backup
    ============================
    diff Backup started at: Sun Jan 15 01:05:03 PST 2012
    Setting date & version Marker into /opt/zimbra/DATE_VERSION.txt
    Doing a hotsync of /opt/zimbra/ to /Backup/fakebackup/
    Disabling the Zimbra crontab...
    Stopping the Zimbra server...

    Host mail.domain.com
    Stopping stats...Done.
    Stopping mta...Done.
    Stopping spell...Done.
    Stopping snmp...Done.
    Stopping cbpolicyd...Done.
    Stopping archiving...Done.
    Stopping antivirus...Done.
    Stopping antispam...Done.
    Stopping imapproxy...Done.
    Stopping memcached...Done.
    Stopping mailbox...Failed.
    Stopping mailboxd...done.
    Stopping mysqld...failed.


    Stopping logger...Done.
    Stopping zmconfigd...Done.
    Stopping ldap...Done.
    zmcontrol shutdown had an error!

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

    Default

    Quote Originally Posted by aarat View Post
    Mail problem got resolved by adding the line in nail.rc however When doing differnetial backup I am getting this error
    Code:
    Writing a diff backup: 02_ZimbraBackup_20120115_DIFF
    into: /Backup/zimbra_dars/ with file sizes of max: 4395M
    Saving Unencrtyped Archive...
    Aborting program. User refused to continue while asking: /Backup/zimbra_dars/02_ZimbraBackup_20120111_FULL
    /Backup/zimbra_dars/02_ZimbraBackup_20120114_FULL.1.dar is required for further operation, please provide the file.
    Dar had a problem!
    Diffs require the Full, or will fail. It is not finding the Full where it is expecting to find it. Did you move it? What is the path to your Full file? The script is looking for it in /Backup/zimbra_dars.

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

    Default

    Quote Originally Posted by kazooless View Post
    I just started getting this error almost every night. One night in 5 it didn't occur and a DIFF is what was scheduled for each of them. I don't think they type has anything to do with it though based on the error message. I am wondering if I might have some corruption in the mailbox? Here is a clip from the logs. What do you think? (The log failure is the same each night)


    Stopping mailbox...Failed.
    Stopping mailboxd...done.
    Stopping mysqld...failed.


    Stopping logger...Done.
    Stopping zmconfigd...Done.
    Stopping ldap...Done.
    zmcontrol shutdown had an error!
    It's not able to stop mailbox and mysqld. You could check the logs in /opt/zimbra/log. I actually had a similar problem, so I modified the script. I added a function to try service shutdown multiple times. The services always stop for me, eventually.
    Code:
    @@ -537,6 +541,35 @@
             fi
     }
     
    +function do_stop_services {
    +    stopTries=0
    +    until [ -z `su - zimbra -c $ZM_HOME"bin/zmcontrol status" | grep Running | head -1 | awk '{print $2}'` ]
    +        do
    +        su - zimbra -c $ZM_HOME"bin/zmcontrol stop"
    +        sleep 60
    +        stopTries=$(expr "$stopTries" + 1)
    +        if [ "$stopTries" -eq "10" ] ; then
    +            echo "Damn thing won't stop"
    +            echo "Restoring crontab"
    +            crontab -u $ZM_USER "$ZM_HOME"crontab.org
    +            echo "Restarting Zimbra services..."
    +            su - "$ZM_USER" -c $ZM_HOME"bin/zmcontrol start"
    +            mail_log
    +            exit 1
    +        fi
    +        done
    +}
    +
    
     function do_backup {
         TYPE=$1
    This function is called if the initial shutdown attempt fails:
    Code:
         #Starting 'service downtime' counter
         DOWNTIMEA=(`date +%s`)
         # Stopping Zimbra
    -    echo "Stopping the Zimbra server..."
    -    echo
    +    printf "Stopping the Zimbra server..."
         su - $ZM_USER -c $ZM_HOME"bin/zmcontrol stop" 
         if [ "$?" -eq "1" ]
         then
             echo "zmcontrol shutdown had an error!"
    -        mail_log
    -        exit 1
    +        echo "Trying to stop services again."
    +        do_stop_services
    Last edited by LaFong; 01-15-2012 at 06:49 PM.

  6. #516
    kazooless is offline Loyal Member
    Join Date
    Mar 2009
    Posts
    91
    Rep Power
    6

    Default

    Thanks for the reply. So should I modify my own script? Or should I download the latest?

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

    Default

    Quote Originally Posted by kazooless View Post
    Thanks for the reply. So should I modify my own script? Or should I download the latest?
    The latest does not have this change. I made several changes to the script, to suit my particular method of use. Either modify the script yourself, or I could make mine available on Dropbox. I added another function for dar rotation, and call my SQL/LDAP dump script, but the other changes are minor.

  8. #518
    kazooless is offline Loyal Member
    Join Date
    Mar 2009
    Posts
    91
    Rep Power
    6

    Default

    I see. I'm not that great at scripting, but I'll look closely and see if I can figure it out myself. If I can't, I'll post again and take you up on the dropbox offer.

    Thanks,

    kazooless

  9. #519
    kazooless is offline Loyal Member
    Join Date
    Mar 2009
    Posts
    91
    Rep Power
    6

    Default

    Okay, I believe I understand how to edit the script with your additions, but before I do, I would like to be sure I understand correctly.

    Your first text box is the creation of a new function that is only called if there is a problem. That call is from the edits in the second box, right? The little "+" signs at the beginning of each line are the only lines you are "adding" to the script, right? Likewise, the "-" signs are lines you are deleting.

    In the first text box you have some lines before and after the lines with the "+" signs to help find the place in the script where it should be placed.

    Am I understanding correctly?

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

    Default

    Quote Originally Posted by kazooless View Post
    Your first text box is the creation of a new function that is only called if there is a problem.
    Correct.
    That call is from the edits in the second box, right?
    Correct.
    The little "+" signs at the beginning of each line are the only lines you are "adding" to the script, right? Likewise, the "-" signs are lines you are deleting.
    Correct.
    In the first text box you have some lines before and after the lines with the "+" signs to help find the place in the script where it should be placed.
    Correct.
    Am I understanding correctly?
    Yes. Since you've probably set a few variables, make a backup of your original script.

Page 52 of 66 FirstFirst ... 242505152535462 ... LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 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
  •