Page 1 of 2

How do YOU backup?

Posted: Mon Jul 30, 2007 7:09 am
by konman
Greetings All - {Linux\Scalix noob alert!!}

I am really impressed with Scalix

I get the impression that Scalix is -:
......Robust - tick
......Fantastic value for money - tick
......Simple enough to get it working - with the wealth of how-to resources - tick

....but what I havent seen is a 'simple' way of backing up your scalix server. Is running scripts the only way? The scripts posted in the forums look managable - but I am hesitant to implement them with my limited knowledge of Linux.
LVM(2) looks way to complex.

Is www.Sep.de the answer ?? - I have got my Credit Card ready if someone can say "yes - it works with V11 and V12 when it comes out"

How do you do it?
What's good to use to give you a good night's sleep without worrying?

Cheers,
KonMan

Posted: Mon Jul 30, 2007 7:56 am
by Valerion
I'm not going to answer your question (probably), but here is some comments from my side:

There's in short 3 ways of doing a backup:

1) Backup while the server runs. Advantage: Easy to set up. Disadvantage: May have some minor mailbox corruption (message moving through the system or between mailboxes). Not supported by Scalix.

2) Shut down the server, then backup Advantage: Easy to set up. Disadvantage: Downtime (may be acceptable).

3) Snapshot backup You suspend the server (all processes stop working), then make an image of the mailstore, then unsuspend the server, and let the backup run off the image. Advantage: No downtime or inconsistencies Disadvantage: You need to plan ahead, set up LVM correctly and use it correctly.

4) You can make archives of indivdual mailboxes (preferably when the user is not logged in). Some scripts combine this with one of the above. Advantage: Can recover a single box easily. Disadvantage: Hard to recontruct the entire mailstore, with all your config changes, so I won't count it as a primary means of backup.

I haven't worked with SEP before, but it would follow one of the above methodologies. Not sure about support, you will have to ask people that use it. LVM can be a bit hard to get started on (was for me), but you can always get in someone (one of the Scalix partners/resellers?) to advise you on this issue, maybe even develop a backup solution for you that fits your needs (May still be SEP, I don't know your requirements).

Scripts are pretty much the Swiss Army knives of the UNIX world, they are used all over, mainly because of the underlying paradigm of small tools doing specialized things, as opposed to lage, complex applications. If you are going to administer a Linux system they are going to come up quite a lot. It may be worth your time to get a book on the basics of Bash scripting (or maybe Perl/Python, a lot more powerful), you will be able to accomplish a lot of functions not directly addressable by a newly installed system, and you would also be more able to understand the addons (like ommaint) and how to modify them for your needs, if you find a situation the developers had not considered.

Posted: Mon Jul 30, 2007 9:16 am
by konman
Valerion - I apreciate your comments.

...just to pick your brains a bit more - For the moment - Im happy just to stop the Scalix server process and copy the relevant files 'manually' from time to time. (..as noted in other posts...)

Can you suggest a 'Norton Ghost' eqivilent of the Linux world...
My rationale is that, until I get a get my scripting up to scratch I will have my (bootable?) DVD(s) image of the harddrive with the working Scalix and in the event of disaster recovery, I can re-instate the harddrive back to that point and then copy the relevant files back.

Regards,
Konrads.

Posted: Mon Jul 30, 2007 9:54 am
by Valerion
If you want a tool like that, look at http://freshmeat.net/projects/g4l/ - never used it, but it seems to fit the bill. And free :)

If you have the space to make a copy of the mailstore (sounds like you will), you can always keep a second copy and rsync or copy (rsync and cp) the files over. rsync copies changed/new/deleted files, while cp copies entire trees. PLEASE NOTE: Like most Linux stuff Scalix is quite sensitive about file ownerships and permissions. These NEED to be correctly preserved (cp and rsync has got switches for that). If you want to read more about the different switches they support, man is your friend (man cp and man rsync). tar (and gzip/bzip2 to do the compression) can be used to make archives of files on disk.

<EDIT> Just read the accusations of copyright inringement at the bottom of that page. Always sad when people start to point fingers. The claimed original is http://www.feyrer.de/g4u/. Don't know if the accusations are true or not, but thought I'd mention it as well.

Posted: Mon Jul 30, 2007 11:18 am
by btisdall
I use g4l to image windows machines to a Linux host - works a treat (it really flies in ntfsclone mode), I've never lost data through it so give it a try, but like any backup method make sure you test the restore somehow, particularly if you're using RAID &/or LVM which might complicate things.

I've also used g4u but it's a good deal more basic in terms of the UI & the functionality. I'll leave you to make your ethical judgement...

Posted: Mon Jul 30, 2007 12:32 pm
by davidz
Valerion wrote:2) Shut down the server, then backup Advantage: Easy to set up. Disadvantage: Downtime (may be acceptable).


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.

Posted: Wed Aug 01, 2007 7:04 am
by konman
Thanks everyone for your feedback - Im starting to 'see the light' the power in scripting. Im reading into cron jobs at the moment and formulating a strategy.

Posted: Wed Aug 01, 2007 7:26 am
by btisdall
Some suggestions for your bookshelf:

Classic Shell Scripting
UNIX Power Tools

And when you want to do more complex tasks (or are just curious):

Learning Perl
The Perl Cookbook

All by O'Reilly.

NB: I don't mean to distract you with Perl since shell scripting is extremely important, but once you try Perl I think you'll be impressed not only by its power but also its ease of use (and of course your Perl scripts will fit nicely into your UNIX toolbox). As a relative latecomer to the 'Pathologically Eclectic Rubbish Lister' (as its author likes to refer to it) I can honestly say it's revolutionised the way I work.

Posted: Thu Aug 02, 2007 5:50 am
by heupink
Just to tell you what I do with my server:

I make two independent backups.

Backup one - to tape
I have purchased storix, and make nightly 'complete system backups' to tape. I can use this backup to restore the complete server in an hour or two. (boot the system with a special storix disaster recovery cd, which then restores the server completely from tape)

Backup two - to disk
Using dirvish (http://www.dirvish.org/) I create a nightly 'snapshot' of the server. This goes really fast (max half an hour), and I keep 10 days of snapshots, which takes very little extra disk space. Before the backup, I create an LVM snapshot, so to have consistant snapshot.

If you like more info on one of the two options, elt me know, I can expand a bit.

Anyway, as I am not always at my work, I like having two independent backups. Even in case one fails, there is NO direct problem at all.

Regards,
Mourik Jan

Posted: Mon Aug 06, 2007 6:35 pm
by adhodgson
Hi,

I implemented the LVM snapshot - it took less than 30 minutes with the sxbackup script I found in the wikki, the only thing now is that we tar it up, and this takes several hours. I will be changing this - probably to rsync a backup to another directory and let BackupExec back the raw directories, or else to use some other system. I think the Sep system just runs a script which is similar to this.

Andrew.

Posted: Tue Aug 07, 2007 6:53 am
by interways2
One quick question: What happens if I do NOT preserve permissions? Can I install a new scalix server setup over a mailstore (restored from backup) with destroyed permissions?

Thanks

Chris

Posted: Tue Aug 07, 2007 7:05 am
by btisdall
Ownerships & permissions are extremely important to scalix. Whilst these can be fixed up using omcheck adding this complication to your upgrade/recovery plan is a REALLY idea IMO.

If you need to backup to a Windows server you could tar your data straight over using cifs - this might help take some load off your scalix box since you'll only be reading from the disk.

Depending on the importance of your system you might consider rsyncing the data over to a dedicated backup Linux box with its own tape system - it needn't be high spec.

Posted: Tue Aug 07, 2007 7:32 am
by interways2
We have set up a dedicated Linux box, but using rsync (basically a script like the one above) the permissions are set to nobody/nogroup on the backup server.

How can I fix this?

We have the same user/group created on the backup server...

Thanks

Chris

Posted: Tue Aug 07, 2007 7:39 am
by btisdall
Are you running rsync as root to preserve ownerships?

Posted: Tue Aug 07, 2007 7:42 am
by interways2
I start it directly from the command line being logged in as root. It is the default SuSE install.