How do YOU backup?

Discuss the Scalix Server software

Moderators: ScalixSupport, admin

interways2
Posts: 45
Joined: Wed Jan 10, 2007 11:59 am

Postby interways2 » Tue Aug 07, 2007 7:43 am

It gives me many errors saying chmod failed. It obviously can not set the user/group.

interways2
Posts: 45
Joined: Wed Jan 10, 2007 11:59 am

Postby interways2 » Tue Aug 07, 2007 8:10 am

Found it!

Have to user the no_root_squash command in the nfs server settingsin /etc/exports

Now it works.

LHD-Tech
Posts: 74
Joined: Tue Feb 20, 2007 1:25 pm
Location: Lompoc, CA
Contact:

Postby LHD-Tech » Mon Aug 13, 2007 6:31 pm

Should all of /var/opt/scalix be backed up? this is the bare minimum to retain messages and permissions and whatnot to restore a failed server?

Our script runs and it tars /var/opt/scalix to a mount point that is acutally a folder on a network drive. I am having troubles with my backups coming out "corrupt". Its a 23+GB file being created over the network, so i am not sure if network traffic is causing a bit here and there to corrupt. I first discovered the error while unpacking a backup to a VM to restore a single users mailbox (they hit the delete button at the wrong time). the unpacking gets to ./license before it errors. I tried using winrar to just navigate through the tar to the folders, same outcome. The command in my script is

Code: Select all

tar -cf backup.tar /var/opt/scalix


I was thinking of rewriting the script to tar on the local drive and then copy the backup.tar to the network share. Any ideas?

-James-

chris
Scalix Star
Scalix Star
Posts: 321
Joined: Mon May 09, 2005 2:56 pm
Location: Freiburg, Germany

Postby chris » Mon Aug 13, 2007 9:14 pm

From the rsync manpage:

-p, --perms preserve permissions

So either add -p to your rsync call, or use archive mode (-a) which would already include preserve permissions.

Chris

griffyx

mbox

Postby griffyx » Tue Aug 14, 2007 9:41 pm

Does anyone use the mbox script method posted on the wiki (http://www.scalix.com/wiki/index.php?ti ... Mbox_Style)? I have been using it nightly via cron and it seems to work? Has anyone experienced corruption or any other issues using this method?

Thanks for your time!

Mark

kanderson

Postby kanderson » Fri Aug 17, 2007 1:25 am

If you lost the permissions, it isn't the end of the world. omcheck will allow you to fix them, but it takes a long time to run on large mailstores.

As far as learning things like scripting, I'll add another book to recommend.

Think Unix by Jon Lassar. It's an unorthodox teaching book, but I found it exceptionally informative, and really fun to read too.

Kev.

Dimitriy
Posts: 19
Joined: Mon Apr 03, 2006 10:28 pm

Postby Dimitriy » Fri Aug 24, 2007 7:28 pm

Does anyone see any problems with using a Naslite Box as a backup?

Naslite doesnt keep permissions as far as i can tell. Is there a way around it?

btisdall
Scalix Star
Scalix Star
Posts: 373
Joined: Tue Nov 22, 2005 12:13 pm
Contact:

Postby btisdall » Sat Aug 25, 2007 11:33 am

Dimitriy wrote:Does anyone see any problems with using a Naslite Box as a backup?

Naslite doesnt keep permissions as far as i can tell. Is there a way around it?


Use a backup method that encapsulates the files in such a way that permissions are preserved, the obvious one would be to write the backup as a tarball to your nas appliance.

It's worth mentioning, however, that a PC of the sort of spec mentioned in the naslite docs could just as well run a full, GUI-less Linux distro. You could then use rsync and/or nfs which would be a more efficient way of backing up. Of course, there's a learning curve with this stuff that may or may not be appropriate to your situation.
Ben Tisdall
www.redcircleit.com
London

Dimitriy
Posts: 19
Joined: Mon Apr 03, 2006 10:28 pm

Postby Dimitriy » Fri Sep 14, 2007 2:00 pm

What would be a simple script that would do the following:

1. Backup all the needed folders/files every day. By backup I mean create a proper tarball.
2. Transfer the tarball by FTP or NFS to a server. Overwrite the old copy.

And I think thats it. Should there be anything else that it should do? The main reason for this backup is just to ensure that the we have a backup of our emails in case our mailserver harddrive croaks. We just want to be able to recover the data from a fairly recent time.

Any help?

Dimitriy

LHD-Tech
Posts: 74
Joined: Tue Feb 20, 2007 1:25 pm
Location: Lompoc, CA
Contact:

Postby LHD-Tech » Fri Sep 14, 2007 6:34 pm

Dimitriy wrote:What would be a simple script that would do the following:

1. Backup all the needed folders/files every day. By backup I mean create a proper tarball.
2. Transfer the tarball by FTP or NFS to a server. Overwrite the old copy.

And I think thats it. Should there be anything else that it should do? The main reason for this backup is just to ensure that the we have a backup of our emails in case our mailserver harddrive croaks. We just want to be able to recover the data from a fairly recent time.

Any help?

Dimitriy


Here is how mine is set up:

Code: Select all

BACKUP_DATE=`date '+%F' --date '1 day ago'`
REMOVE_DATE=`date '+%F' --date '5 days ago'`
BACKUP_DEVICE=/backup/$BACKUP_DATE-backup.tar
REMOVE_DEVICE=/misc/mail_backup/$REMOVE_DATE-backup.tar

/opt/scalix/bin/omshut                                        2>&1 >> $MAINTLOG
tar -cf $BACKUP_DEVICE /var/opt/scalix          2>&1 >> $MAINTLOG
/opt/scalix/bin/omrc                                            2>&1 >> $MAINTLOG
mv /backup/2* /misc/mail_backup/$BACKUP_DATE-backup.tar


this script creates the tar file on the local hard drive and then moves it to another server for storage. We keep 4 days of backups. The backup will live for 4 days before the script deletes it on the 5th day. You will need to change this for your own information but its the general idea of how its done.


QUESTION: Can anyone help me in figuring out why every couple of days i will get a backup file that is "corrupt"?

lilkev
Posts: 17
Joined: Tue Aug 23, 2005 9:15 am
Contact:

WOW! This is WHat I have been looking for! One Question tho

Postby lilkev » Sat Sep 15, 2007 8:08 pm

Davids Post here is Awesome. Now here's my question regarding restoring.
If I was to use htis script and export the mailstore, how do I then do a restore?

1) Build Box, Install linux
2) Install Scalix
3) Import Mailstore

Will this re-create all the users in SAC and basically "Clone" the original box? I have one site where I am running community edition and I want to clone up a second box that has a nightly updated copy of the WHole Scalix server in case the first one fails. Sort of a Hot Swappable redundant server.

Kev


davidz wrote:This is what we do. Here is the simple shell script we use:

Code: Select all

date
/opt/scalix/bin/omshut

sleep 60

rsync -auv --delete /var/opt/scalix /mnt/EmailBackup


/opt/scalix/bin/omrc
date


Pretty much just outputs the current Date/Time so we can track how long it is taking to run. Then it stops the server, wait 60 seconds for the server processes to stop, then rsync all the data to another system. Start the server back up and output the Date/Time it finished.

Currently we have about 35 gigs in the mailstore and the rsync takes less than 10 minutes. We run this every night. The first rsync obviously took longer, but the update each night is fast. And the backup location is on a completely separate server. (NFS mount).

Just my two cents!

--David

PS. I have restored from this with no problems (hard drive died). Just install new Hard Drive, install Linux (whichever you use). Copy mailstore back from backup. Install Scalix Server. It detects existing mailstore and everything worked great. That's overly simplified but you get the idea.

chris
Scalix Star
Scalix Star
Posts: 321
Joined: Mon May 09, 2005 2:56 pm
Location: Freiburg, Germany

Postby chris » Sun Sep 16, 2007 3:44 am

Hi, I just want to mentions something reading tthe examples posted such as:

LHD-Tech wrote:

Code: Select all

/opt/scalix/bin/omshut                                        2>&1 >> $MAINTLOG
tar -cf $BACKUP_DEVICE /var/opt/scalix          2>&1 >> $MAINTLOG
/opt/scalix/bin/omrc                                            2>&1 >> $MAINTLOG
mv /backup/2* /misc/mail_backup/$BACKUP_DATE-backup.tar



and

davidz wrote:This is what we do. Here is the simple shell script we use:

Code: Select all

date
/opt/scalix/bin/omshut
sleep 60
rsync -auv --delete /var/opt/scalix /mnt/EmailBackup
/opt/scalix/bin/omrc
date


Although there is no functional problem with doing omshut/omrc, we do recommend doing zero downtime backups with omsuspend.

Ideally, you make /var/opt/scalix an LVM at install time, and then you can

Code: Select all

omsuspend
lvmcreate ...
omsuspend -r
$backup_cmd


which allows you to backup a consistent copy of the mailstore without stopping Scalix. Check out the omsuspend manpage for more detail. The backup command can be whatever works in your organization, be it rsync, a commercial backup program, or just creating a tarball on tape.

Hope this is useful,

Chris

rex007can

Postby rex007can » Thu Sep 20, 2007 11:49 am

I just use a corporate backup system with a Linux client.
Do a full every week/month and a diff every weekday.

I have tested a restore procedure multiple times and have always been able to get a functionnal server back up and running with everyone's mailboxes.
I haven't come accross mailbox corruption bad enough that omscan couldn't fix.

I I did, I would just go back one week plus diffs, restore to another server, extract the one mailbox and import it back into prod.

Anyways...works for me...


Return to “Scalix Server”



Who is online

Users browsing this forum: Google [Bot] and 3 guests

cron