How can you backup the directory?

Discuss the Scalix Server software

Moderators: ScalixSupport, admin

dwerthmu
Posts: 84
Joined: Wed Apr 04, 2007 11:19 am

How can you backup the directory?

Postby dwerthmu » Tue Jan 15, 2008 2:53 pm

I see there are scripts and tools to backup and restore mailbox data, these work quite well for single item and entire mailboxes.

Is there a tool to backup and restore the entire directory?

The idea here is be able to build or rebuild a new server have scalix installed and restore the directory and restore mailboxes.
Right now if I backup a mailbox with sx-backup, copy that a users file to another scalix server create the same user and restore the data to it you can access the data. The mailbox is restored to a secondary server quite easily. This is a good thing. Now how about the directory.

I realize there is the snapshot and rsync tool, but you can never have enough backups and options. Also from the threads the snapshots on RHEL boxen hasn't been perfect.

mikevl
Scalix Star
Scalix Star
Posts: 596
Joined: Mon Feb 02, 2004 8:32 pm
Location: New Zealand

Postby mikevl » Tue Jan 15, 2008 5:11 pm

Hi

LVM Snapshot is the Scalix recommended option

Yes there were issues with LVM under RHEL4 - RHEL4.3 but that has been fixed for versions 4.4 and above.

Some people had incorrectly configured LVM so you need to allocate 50% of your disk to LVM and 50% to snapshot.

All will work well

Mike v

Goulou
Posts: 11
Joined: Mon Jan 07, 2008 11:34 am
Location: France

Postby Goulou » Mon Mar 03, 2008 8:19 pm

According to The Linux Documentation Project, you don't need that much space for Snapshot : the allocated space "should be large enough to hold all the changes that are likely to happen to the original volume during the lifetime of the snapshot".
If your mailboxes are, say 10Gb, a snapshot with a size of 1 or 2 Gb should be enough, provided that scalix activity doesn't make too much change (To be confirmed by scalix member?, maybe even some read access may do changes to the filesystem...).
What I would advice (and what I'm just about to configure would be :
-use omsuspend -s {few seconds} (making snapshot is really fast)
-for mbox of 10Gb, take snapshot of ~2Gb
-omsuspend -r to resume the server
-make rsync immediately after
-discare snapshot (since its existence implies that any write access be done twice : one in the snapshot lv to record old version, and one to "normal" lv to record new version)

You should do it few times to test and find optimal values.

Just beware that in case your snapshot was just too small and too many changes happend... it is automatically discared by LVM when it reaches its maximal size!

Goulou

mikevl
Scalix Star
Scalix Star
Posts: 596
Joined: Mon Feb 02, 2004 8:32 pm
Location: New Zealand

Postby mikevl » Mon Mar 03, 2008 9:01 pm

Hi

just as an aside to the last mesasage. You are right about the changes. However looking through the forums you will find some spactacular failures where people thought they were getting backups and didn't for some or other. They have learned by experience that trying to estimate the size of backup is not straight forward.

Ie you may have a log grow very large. Also there are some directories, cache data, temp folders and other stuff wich changes slightly as Scalix goes through its day.

If you happen to strike a bad day I would hate to think thaty ony 50% of my data was only backed up via LVM. This would lead to the total data set be usless. You can make assumptions but be carefull.

A lot of talk on the forums is now 50/50

Mike

Goulou
Posts: 11
Joined: Mon Jan 07, 2008 11:34 am
Location: France

Postby Goulou » Mon Mar 03, 2008 9:07 pm

Thanks for your reply, since I rely perfectly with that :-)

That's in particular why I mentionned the "rsync" right after taking snapshot, and before discaring it manually : that way, you get an inexpensive way of doing your backup using snapshot, but you know that you do have (or don't have, but at least you know it) your backup. If the changes grew too quickly, you get your rsync failed, sure, but you know it...

Thanks again for your precision, I didn't read all other posts before answering... I think I'l try to be more carefull anyway.

mikevl
Scalix Star
Scalix Star
Posts: 596
Joined: Mon Feb 02, 2004 8:32 pm
Location: New Zealand

Postby mikevl » Tue Mar 04, 2008 3:30 am

Hi

The fact is that you do not normally get any indication of failure. If your snapshot is to small then your rsyn will still sync the data you have and you rcynced backup will caontain "a small set of data. OOPS when you want to restore.

A typical script may look like this
/opt/scalix/bin/omsuspend -s 299 & # Pause OM while making snapshot
/bin/sync # This is a must!
# create_snapshot /var/opt/scalix /scalixsnap # Create snapshot FS
/usr/sbin/lvcreate -L18G -s -n scalixsnap /dev/vgscalix/lvscalix
/bin/sync #another must
/opt/scalix/bin/omsuspend -r # Unpause OM after snapshot ready
/bin/mount /dev/vgscalix/scalixsnap /mnt/snapshot
/bin/nice -n 19 /usr/bin/rsync --bwlimit=1000000 -a -z --delete /mnt/snapshot/ root@192.168.10.210:/backup/var/opt/scalix/
/bin/umount /mnt/snapshot
/usr/sbin/lvremove -f /dev/vgscalix/scalixsnap


However there are many ways to achieve the end result.

You may also wish to build safety into your script.
Ours detect the presence of an existing snapshot, the absence of an rsync partener and a few other mistermeaners so that we don't get crashes due to mass issues.

Hope this helps

Mike


Return to “Scalix Server”



Who is online

Users browsing this forum: No registered users and 1 guest

cron