Results 1 to 7 of 7

Thread: question re: NFS as backup target

  1. #1
    bisi is offline Junior Member
    Join Date
    Aug 2012
    Posts
    6
    Rep Power
    3

    Default [SOLVED] question re: NFS as backup target

    Rather than engaging in some necromancy (/opt/zimbra/backup to NAS box via NFS?

    Quote Originally Posted by robertcl View Post
    ...I'm not really seeing any drawback but perhaps I'm overlooking something...
    One thing I am wondering about (and I haven't found out if there is a fix in quite a bit of searching through the docs and forum), is how to prevent the OS partition from being filled up if the NFS mount fails?

    I have had the experience (not with zimbra) where the backup target somehow failed to mount via NFS and the backups wrote to the mount point, filling the OS partition.

    Failing to boot the mail server because the backup target is not present is not a viable option in this client's case, so I am wondering if anyone knows of or has devised a way to prevent backups from happening if the NFS target is not mounted as expected.

    I'm reluctant to rely on the "Backup minimum free space" option (so much trust that everything is going according to plan). I'd much rather a failed backup email because the NFS target was not there, or some other solution I don't yet know about.

    Thanks in advance!
    Last edited by bisi; 08-17-2012 at 06:50 PM. Reason: problem solved

  2. #2
    bdial's Avatar
    bdial is offline Moderator
    Join Date
    Jul 2007
    Location
    Baltimore
    Posts
    1,649
    Rep Power
    11

    Default

    chown /opt/zimbra/backup to root, and set it 700. The zimbra backup process runs as zimbra, so if it isn't mounted it won't be able to write the backup there and will immediately fail.

    I do this with an iscsi target as my backup. When it's mounted ith as the correct permissions. I assume nfs would behave the same way

  3. #3
    lytledd is offline Elite Member
    Join Date
    Dec 2009
    Location
    Michigan
    Posts
    453
    Rep Power
    5

    Default

    That's simple. Once you've mounted the NFS directory, check to see if something within that directory exists

    unix - How to check if a directory exists in a shell script - Stack Overflow

    Doug
    Ben Franklin quote:

    "Those who would give up Essential Liberty to purchase a little Temporary Safety, deserve neither Liberty nor Safety."

  4. #4
    Brad_C is offline Special Member
    Join Date
    Apr 2012
    Posts
    100
    Rep Power
    3

    Default

    Quote Originally Posted by bdial View Post
    I assume nfs would behave the same way
    Brilliant. Just verified that nfs does behave the same way. That scratched an itch I'd not got around to yet. Thanks!

  5. #5
    bisi is offline Junior Member
    Join Date
    Aug 2012
    Posts
    6
    Rep Power
    3

    Default

    Quote Originally Posted by bdial View Post
    chown /opt/zimbra/backup to root, and set it 700. The zimbra backup process runs as zimbra, so if it isn't mounted it won't be able to write the backup there and will immediately fail.
    Verified in testing that it works this way. Tonight we'll see how the zmbackup (?) script deals with the situation (failure scenario - no NFS mount, no (vmdk) partition mounted, /opt/zimbra/backup owned and with permissions as above).

    Thanks in advance for an excellent solution.

  6. #6
    bisi is offline Junior Member
    Join Date
    Aug 2012
    Posts
    6
    Rep Power
    3

    Default

    Quote Originally Posted by bisi View Post
    Tonight we'll see how the zmbackup (?) script deals with the situation (failure scenario - no NFS mount, no (vmdk) partition mounted, /opt/zimbra/backup owned and with permissions as above).
    Well, not quite as I had hoped (but close!). The backup failed as desired, but the notification of its failure was not in its expected place in this morning's email task.

    Normally a "ZCS Backup Report: SUCCESS" (or FAIL due to insufficient disk space) message goes to monitor@mydomain.com.

    The /opt/zimbra/log/mailbox.log shows the backup failing for the desired reason, and it shows a message being delivered (via lmtp) to admin@clientdomain.com (on the Zimbra server). Logging on as admin to check the mailbox shows the failure message there (see below).

    The monitor@ address that we have been using is entered in the Configuration->Global Settings->Backup/Restore section of the Zimbra administration console.

    First question, why don't all the backup/restore messages to to the designated address (monitor@...)?

    Second (and more important question), what's the best workaround for making sure the messages do go the desired monitoring address? I have entered a forwarding address in admin's email config, but I'll have to wait thru another iteration to find out if this works for this failure scenario (during normal operation). I doubt I've thought of all the alternatives.

    (backup failure message delivered to admin@clientdomain.com)
    Code:
    From: admin@client.com
    To: admin@client.com
    Sent: Thursday, August 16, 2012 1:00:09 AM
    Subject: zmbackup for mail.client.com failed
    
    Error occurred: Invalid backup target: Backup target /opt/zimbra/backup is not writable

  7. #7
    bisi is offline Junior Member
    Join Date
    Aug 2012
    Posts
    6
    Rep Power
    3

    Default

    Quote Originally Posted by bisi View Post
    Second (and more important question), what's the best workaround for making sure the messages do go the desired monitoring address? I have entered a forwarding address in admin's email config, but I'll have to wait thru another iteration to find out if this works for this failure scenario (during normal operation).
    OK - so this worked. Failure message (NOT the ZCS Backup Report: FAIL) was forwarded from admin@clientdomain.com to the monitor@mydomain.com address, stating that /opt/zimbra/backup was not writeable. Ordinary backup worked as expected, with ZCS Backup Report: SUCCESS message sent directly to monitor@mydomain.com by the zmbackup script.

    to recap --
    1. (if needed) create a forward from the admin account to whatever email account you use to monitor backups (the backup reporting mechanism does not capture the failure scenario we are creating)
    2. on the zimbra server:
      1. chown root:root /opt/zimbra/backup
      2. chmod 0700 /opt/zimbra/backup
    3. on the NFS server:
      1. chown xxxx:yyyy /path/to/export/for/zimbrabackup
      2. chmod 0755 /path/to/export/for/zimbrabackup
    4. on the zimbra server, nfsmount the above export to /opt/zimbra/backup in fstab (or whatever)
    5. test
    6. NB - xxxx and yyyy are the UID and GID of the zimbra user & group on the zimbra server (arbitrary numbers/users/group on the nfs host)

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] backup target doesn't exist... but it does
    By bwm71 in forum Administrators
    Replies: 6
    Last Post: 04-21-2009, 09:25 AM
  2. [SOLVED] Target Domain Based Mail Relay question
    By ghanedan in forum Administrators
    Replies: 1
    Last Post: 11-12-2008, 04:50 AM
  3. Incremental Backup Target
    By lstroud in forum Administrators
    Replies: 5
    Last Post: 08-19-2008, 01:49 PM
  4. [SOLVED] Changed Backup Target Did Not Change For LDAP
    By rfoster in forum Administrators
    Replies: 4
    Last Post: 11-13-2007, 04:42 PM
  5. Set default backup target for zmschedulebackup?
    By Kirkaiya in forum Administrators
    Replies: 2
    Last Post: 04-11-2006, 02:18 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •