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
Printable View
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
This is (adapted from) the simplest script I use. I use SSH to another server rather than tape.
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.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 ==
Thats about as simple as I can make it. Hope it's of use.
Jon
You should probably take a look at the scripts here as well:
Backup and Restore Articles - Zimbra :: Wiki