Zimbra offers Open Source email server software and shared calendar for Linux and the Mac
Go Back   Zimbra :: Forums > Zimbra Collaboration Suite > Administrators

Welcome to the Zimbra :: Forums!
Welcome, if you would like to post a comment please register. We also encourage you to explore all things Zimbra with our team and members of the community.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-28-2010, 06:56 AM
Intermediate Member
 
Posts: 20
Default Help me with a basic backup script please

ok, so I don't understand why this is not working.... I'm sure it's just something simple and stupid that I'm doing wrong. If I run this script manually, it works great, but when I set it up as a cron job, it seems to run (it logs it in the log file I made and makes the bz2 file) but the bz2 file ends up being blank.

I'm doing two rsync's, so that I can copy everything I can while zimbra is running and shut it down as short a time as possible for an additional rsync.

I'm running Zimbra 6.06 opensource edition on Ubuntu Server 8.04 LTS.

the cron job I setup was as follows:

00 01 * * * /etc/customscripts/zimbrabackup

The script is this:
Code:
#!/bin/bash
DAYOFWEEK="`date '+%A'`"

date >> /diskbackups/zm-backup.log 
echo "Backup Started."  >> /diskbackups/zm-backup.log 

mkdir /diskbackups/TEMP
rsync -ruavzHp /opt/zimbra/ /diskbackups/TEMP

/etc/init.d/zimbra stop
pkill -9 -u zimbra
rsync -ruavzHp /opt/zimbra/ /diskbackups/TEMP
/etc/init.d/zimbra start

tar cjpf /diskbackups/"backup_zimbra.${DAYOFWEEK}.tar.bz2" /diskbackups/TEMP/
rm -rf /diskbackups/TEMP

#Keep track of Ending date and time
date >> /diskbackups/zm-backup.log
echo "Backup Completed." >> /diskbackups/zm-backup.log
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads

Why Join?

Registering let's you ask questions, makes it easier to search, displays any files attached to posts, and notifies you about replies.

blog.zimbra.com




 

SEO by vBSEO ©2011, Crawlability, Inc.