Results 1 to 6 of 6

Thread: [SOLVED] Please check my backup method

  1. #1
    Join Date
    May 2010
    Posts
    171
    Rep Power
    5

    Default [SOLVED] Please check my backup method

    I'm testing the Network Edition. I'm using the backup feature to backup to the local disk at /opt/zimbra/backup.

    I've spent the last few hours figuring out how to create a copy of the backups to a Windows share for tape backup.

    I've gone through a lot of different posts and I've gathered that it is best to create an archive which I transfer rather than the individual files and folders.

    I want to verify that the commands and options I'm using are correct.

    Btw I've already mounted the Windows share using cifs.

    Create archive:
    Code:
    sudo tar zcvf backup.tgz -C /opt/zimbra/backup .
    Is it correct to run the above command as root or should I run as zimbra, i.e. sudo su - zimbra?

    Will all the permissions and links be correct if I need to restore and untar using?

    Code:
    sudo tar zxvf backup.tgz -C /opt/zimbra/backup .
    Thanks

  2. #2
    Join Date
    Sep 2006
    Location
    477 Congress Street | Portland, ME 04101
    Posts
    1,374
    Rep Power
    11

    Default

    Yes, if you are going to put the backups on a Windows server to be able to copy them to tape I agree that I would create a tar.gz file first.

    Assuming the Windows share is mounted via cifs at, say, /mnt/win-back/, then I would run first as root:

    Code:
    tar -czvf /root/backup_$(date +%y%m%d).tar.gz /opt/zimbra/backup
    to create the backup file, and then I would run as root:

    Code:
    cp ~/backup*.tar.gz /mnt/win-backup/
    to copy the tar.gz files to the Windows server.

    Probably you'll want to change the Zimbra crontab to run mostly full backups every day (do run an incremental every now and then to move the old redo logs to /opt/zimbra/backup). You'll need to delete the old tar.gz backup files from /root periodically.

    This could all be automated via a bash script too at some point.

    Hope that helps get you started!

    Mark

  3. #3
    Join Date
    May 2010
    Posts
    171
    Rep Power
    5

    Default

    Hi Mark,

    Can you please explain why you create the archive at "/root/" before copying to the Windows share. Does this have something to do with permissions?

    Also, why do you suggest that I change to full backups rather than the default setup?

    With regards to restoring from tape if necessary. Is it as simple as copying the archive back and overwriting /opt/zimbra/backup?

    Thanks for your help
    Jonathan

  4. #4
    Join Date
    Sep 2006
    Location
    477 Congress Street | Portland, ME 04101
    Posts
    1,374
    Rep Power
    11

    Default

    Quote Originally Posted by yonatan View Post
    Hi Mark,

    Can you please explain why you create the archive at "/root/" before copying to the Windows share. Does this have something to do with permissions?
    I just used /root as an example, but there is a permissions element to my strategy, and one other thing as well. I have not had good luck creating tar.gz files 100% reliably to network file systems directly except those presented via a good SAN. Further, local DASD is generally faster than network storage so the tar.gz file creation will happen faster, generally, on local disk.

    The permissions element is that whichever user account you use to create the tar.gz file, it needs to be able to read all of /opt/zimbra/backup, and root is certainly convenient for that. You could certainly create a new Linux user account and make it a member of the zimbra group etc., that would be your call.

    Quote Originally Posted by yonatan View Post
    Also, why do you suggest that I change to full backups rather than the default setup?
    You are right that if you are tar.gz'ing the entire /opt/zimbra/backup tree every day, you don't need to change the default setup. But this means you are copying much of the same data every day. In our experience, folks who are shipping copies of /opt/zimbra/backup off-server (if not off-site) look to to avoid copying the same data twice--this becomes more of a mandate when your mail store gets larger.

    So, if you create independent full backups everyday and just copy/move each day's backup off-server every day, you'll wind up with a more granular set of scripts to copy off the latest subdirectory in the sessions subdirectory. This wiki article may help: Ajcody-Backup-Restore-Issues - Zimbra :: Wiki


    Quote Originally Posted by yonatan View Post
    With regards to restoring from tape if necessary. Is it as simple as copying the archive back and overwriting /opt/zimbra/backup?

    Thanks for your help
    Jonathan
    It could be, but you may not want to do it that way. Take a read through Adam Cody's wiki article and that may help you sort out what strategy is best for your environment.

    Hope that helps,
    Mark

    P.S. One other thing to keep in mind: redo logs. Full backups leave them in place. Incremental backups move them into the /opt/zimbra/backup tree.

  5. #5
    Join Date
    May 2010
    Posts
    171
    Rep Power
    5

    Default

    Excellent! Thank you kindly for sharing your wisdom

  6. #6
    Join Date
    Aug 2009
    Location
    The Hague -- The Netherlands
    Posts
    214
    Rep Power
    6

    Default

    One piece of advice: include your /opt/zimbra/conf folder in the backup and regularly (say hourly or 2hourly) sync your redologs (/opt/zimbra/redolog) to a safe place. The conf folder will make disaster recovery easier and with the redologs you can restore up to the point of the last redolog sync. Losing an hour worth of emails is far better than losing a whole day.

Similar Threads

  1. Replies: 658
    Last Post: 04-04-2014, 09:01 AM
  2. Backup using incremental method
    By jayarajmohan in forum Administrators
    Replies: 1
    Last Post: 10-25-2010, 11:45 PM
  3. [SOLVED] Backups failing, "unable to read metadata for account"
    By smcgrath1111 in forum Administrators
    Replies: 10
    Last Post: 04-10-2008, 03:15 PM
  4. No response from Jetty on clean 5.02 OS install
    By cniknet in forum Administrators
    Replies: 0
    Last Post: 02-16-2008, 11:17 AM
  5. FYI: ZCS NE backup to fuse/sshfs mount, worked.
    By jagipson in forum Administrators
    Replies: 0
    Last Post: 09-28-2007, 06:37 AM

Posting Permissions

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