Results 1 to 4 of 4

Thread: Backup using tape backup

Hybrid View

  1. #1
    Join Date
    Jun 2009
    Posts
    61
    Rep Power
    6

    Default Backup using tape backup

    Hi all

    I have a tape backup, But I need to make the backup of zimbra on a Tape backup IBM SCSI, somebody know a shell script ??

    Regards

  2. #2
    Join Date
    Jul 2008
    Location
    UK
    Posts
    171
    Rep Power
    7

    Default

    This is (adapted from) the simplest script I use. I use SSH to another server rather than tape.

    Code:
    #!/bin/bash
    ZIMBRADIR=/opt/zimbra
    BACKUPDIR=/opt/zbackup
    TAPE=/dev/tape
    OPTS=-zcf
    
    # Timestamp start
    echo ==
    echo == Backup started: $(date +"%d/%m/%Y %H:%I:%S") ==
    echo ==
    
    # Live sync before stopping Zimbra to minimize sync time with the services down
    rsync -aHK --delete $ZIMBRADIR $BACKUPDIR
    
    # Timestamp server stop
    echo ==
    echo == Zimbra services stopped: $(date +"%d/%m/%Y %H:%I:%S") ==
    echo ==
    
    # Stop Zimbra
    su - zimbra -c"/opt/zimbra/bin/zmcontrol stop"
    sleep 15
    kill -9 `ps -u zimbra -o "pid="`
    
    # Cold sync to bring backup directory up-to-date
    rsync -aHK --delete $ZIMBRADIR $BACKUPDIR
    
    # Restart Zimbra
    su - zimbra -c"/opt/zimbra/bin/zmcontrol start"
    
    # Timestamp server start
    echo ==
    echo == Zimbra services started: $(date +"%d/%m/%Y %H:%I:%S") ==
    echo ==
    
    # Tarball the Zimbra files onto the tape
    tar $OPTS $TAPE $BACKUPDIR
    
    # Timestamp finish
    echo ==
    echo == Backup finished: $(date +"%d/%m/%Y %H:%I:%S") ==
    echo ==
    I run this as a cron job with output redirected to a file, then e-mail the file at about 6AM. As it is it'll use compression, change to "OPTS=-cf" for uncompressed (quicker/larger) backups.

    Thats about as simple as I can make it. Hope it's of use.

    Jon

  3. #3
    Join Date
    Nov 2008
    Posts
    7
    Rep Power
    7

    Default

    Hi,


    just take care here with:
    kill -9 `ps -u zimbra -o "pid="`

    Not all zimbra process run under "zimbra" user, for example: mta (postfix) is running by postfix users and the postfix master process is launched by root !

    best regards


    Quote Originally Posted by jonallport View Post
    This is (adapted from) the simplest script I use. I use SSH to another server rather than tape.

    Code:
    #!/bin/bash
    ZIMBRADIR=/opt/zimbra
    BACKUPDIR=/opt/zbackup
    TAPE=/dev/tape
    OPTS=-zcf
    
    # Timestamp start
    echo ==
    echo == Backup started: $(date +"%d/%m/%Y %H:%I:%S") ==
    echo ==
    
    # Live sync before stopping Zimbra to minimize sync time with the services down
    rsync -aHK --delete $ZIMBRADIR $BACKUPDIR
    
    # Timestamp server stop
    echo ==
    echo == Zimbra services stopped: $(date +"%d/%m/%Y %H:%I:%S") ==
    echo ==
    
    # Stop Zimbra
    su - zimbra -c"/opt/zimbra/bin/zmcontrol stop"
    sleep 15
    kill -9 `ps -u zimbra -o "pid="`
    
    # Cold sync to bring backup directory up-to-date
    rsync -aHK --delete $ZIMBRADIR $BACKUPDIR
    
    # Restart Zimbra
    su - zimbra -c"/opt/zimbra/bin/zmcontrol start"
    
    # Timestamp server start
    echo ==
    echo == Zimbra services started: $(date +"%d/%m/%Y %H:%I:%S") ==
    echo ==
    
    # Tarball the Zimbra files onto the tape
    tar $OPTS $TAPE $BACKUPDIR
    
    # Timestamp finish
    echo ==
    echo == Backup finished: $(date +"%d/%m/%Y %H:%I:%S") ==
    echo ==
    I run this as a cron job with output redirected to a file, then e-mail the file at about 6AM. As it is it'll use compression, change to "OPTS=-cf" for uncompressed (quicker/larger) backups.

    Thats about as simple as I can make it. Hope it's of use.

    Jon

  4. #4
    Join Date
    Feb 2007
    Location
    Portland, OR
    Posts
    1,147
    Rep Power
    10

    Default

    You should probably take a look at the scripts here as well:
    Backup and Restore Articles - Zimbra :: Wiki

Similar Threads

  1. Replies: 658
    Last Post: 04-04-2014, 10:01 AM
  2. zimbra opesource Backup Script Problem!
    By tashi in forum Administrators
    Replies: 4
    Last Post: 03-31-2009, 12:49 AM
  3. ZCS NE Backup - Archiving To Tape Is To Slow
    By Chewie71 in forum Administrators
    Replies: 10
    Last Post: 09-19-2008, 05:59 PM
  4. [SOLVED] Backups failing, "unable to read metadata for account"
    By smcgrath1111 in forum Administrators
    Replies: 10
    Last Post: 04-10-2008, 04:15 PM
  5. NE Backup best practises
    By Klug in forum Administrators
    Replies: 3
    Last Post: 05-29-2006, 09:32 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
  •