PDA

View Full Version : OSX server Backup


gordo019
03-25-2002, 05:14 PM
I am not a server Admin type guy. But I have a OSX server and I need to backup our OSX server. I just need a basic backup (mirror image) of the server's hard drive so if the drive dies I can switch to the second backup drive and bootup easily should the first drive fail.

Can I get some ideas on how to do this? Mostly, has anyone found a good OSX app that backups an OSX Mac located at a server farm? I really don't need a fancy backup app.

robh
03-25-2002, 05:24 PM
For a simple verbatim copy of one drive onto another, try ditto (/usr/bin/ditto) and run it something like this..

ditto -rsrc / /Volumes/Mirror_disk

Use '-v' or '-V' flags for extra verbosity.

gordo019
03-25-2002, 06:19 PM
Ok Thanx Rob.

What about an automatic solution?

robh
03-25-2002, 06:37 PM
Put it in a "cron" job. If you don't know about cron it's worth learning. I'm sure you'll be able to find a tutorial someplace.

BTW, I have a Perl script wrapper for ditto that does incremental backups..

http://www.imdb.demon.co.uk/OSX/backup

Use it at your own risk.

gordo019
03-25-2002, 09:57 PM
It has been mentionned to me that ditto does not work with
HFS+ volumes, only ufs. Is this correct?

gowrann
03-26-2002, 02:21 AM
yes true -

but by adding the "-rsrc" option you are copying the resource fork files thus all the data on the HFS drive can be backed up. However I have also seen the option "-rsrcFork" mentioned - I am not 100% sure if it makes a difference or which one is preferred.
Try it out on a small directory containing files generated by classic apps and see if the backed up files are useable.

gowrann
03-26-2002, 02:41 AM
Here is the man:


[osxtest:~] gowrann% ditto
Usage: ditto [-v] [-V] [-arch archVal] [-bom bomFile] [-rsrcFork] src [ ... src] dst
-v print a line of output for each src copied
-V print a line of output for every file copied
-arch archVal fat files will be thinned to specified archVal
multiple -arch options can be specified
archVal should be one of "m68k", "i386", "hppa", "sparc", etc
-bom bomFile only files present in the specified bom are copied
-rsrc copy preserving resource forks

I guess they are interchangeable!!

gordo019
03-26-2002, 10:35 AM
thanx for comments. As I have said I am not Unix guy and nothing on OSX is ever for sure or easy. I am still looking for an EASY solution to something that should be easy to do and not feel like a programmer testing beta code. Any other ideas out there? Any OSX app that can just backup a HFS/Mac formatted hard drive?

gowrann
03-26-2002, 06:31 PM
Dantz Retrospect - live version is currently shipping.

gowrann
03-27-2002, 02:59 AM
but it"ll cost !
ditto cost nitto!

gordo019
03-27-2002, 08:44 AM
This true. Because we have OSX server we have to buy the workgroup verson which is around $300. This is alot of dough just to backup a hard drive. So again, I solict for ideas. I need something to backup a OSX server, I just want to mirror my OSX server to a second drive. If the first drive fails, then I want to switch to the backup drive with its copy of OSX server ready to go. I don't want to do alot of command-line cowboying. If there was a simple routine to automatically backup the OSX server once a week. I would be a happy camper.

What are other people doing to backup their OSX servers?

robh
03-27-2002, 09:34 AM
I don't understand why you are ignoring "ditto" and "cron". Whatever route you end up taking will involve some learning of a new tool, so it may as well be cron.

gordo019
03-27-2002, 10:17 AM
One thing that scared me about your cron solution was your disclaimer. "use at your own risk". I tend avoid software with this kind of warning. Especially when it comes from the author and I am weak at implimenting it from the command line.
Also keep mind that many of us OSX server users got into OSX server because we are not UNIX users and we don't want to spend time administrating a server. I was hopeing for a plugin and play server [:-)] instead I am spending more time on the server configuration and setup, than my normal work; building web sites. Maybe I should go back to letting an ISP handles my server needs, but they were too costly and restrictive as well.

robh
03-27-2002, 12:31 PM
The "use at your own risk" disclaimer relates to my script, not ditto, not cron.

I've given you the command to backup a drive with ditto. Cron is trivially simple. Your automated backup using ditto and cron will involve adding 1 line to a cron config file. That one line will be a schedule (what minute, hour, day) and a command (the call to ditto).

e.g.


30 9 * * * root /usr/bin/ditto -rsrc / /Volumes/Backup


To run ditto at 09:30 every day of the month, every month of the year and every day of the week, and run it as user 'root'.

Stick that in /etc/crontab.

gordo019
03-27-2002, 01:53 PM
Ok Rob thanx for all the help. That does look easy.

hschickel
03-27-2002, 03:48 PM
ditto will back up your drive but I fear it won't be bootable when the time comes. There are a few added extras that need to happen to make that work. There are a number of scripts floating around that cover all the bases (you can do a search on Mac OSX Hints) and one guy has put a very nice gui on his script.

Check out Mike Bombich's homepage (www.bombich.com) for tips and especially check out his Carbon Copy Cloner (http://www.bombich.com/software/ccc.html). I believe this will do everything you're asking for. With the exception of setting the invisible bits on a few of the root folders it creates a perfect and BOOTABLE clone.

Hugh

ps - if your drive to image is under 4gigs and you don't mind a trip to OS9 - Apple's own ASR (2.1.2 or higher) will create a completely perfect clone at a very high rate of speed.

gordo019
03-27-2002, 04:25 PM
It is unclear to me if Carbon Copy Cloner will make a bootable copy of OSX or a disk image. It also unclear to me if this will work with for OSX server people. Is there anyone out there who is actually and successfully using this product?

hschickel
03-27-2002, 05:17 PM
It is unclear to me if Carbon Copy Cloner will make a bootable copy of OSX or a disk image. It also unclear to me if this will work with for OSX server people. Is there anyone out there who is actually and successfully using this product? I can personally vouch for CCC for all points on your list.

Hugh

ps - Gordo, I've never seen a piece of software that is not "use at your own risk." You may want to check the licenses or READ MEs that come with your software if you believe otherwise. On a side note - this lack of product liability has been one of the things fueling the massive growth in the industry.

mervTormel
03-27-2002, 05:19 PM
a couple of concerns here for gordo...

robh, the single line ditto will, indeed, backup the source, but it will have problems that would need tedious attention to make it usable, and i think gordo wishes to avoid most of that.

gordo, sadly, you can't avoid all of that. some of that, but not all. like it or not, we are now administrators of these boxes and with that comes responsibility. you can't have it both ways.

lamentably, your wish for a automated aqua app style of solution is going to cost money. CCCloner is free, but automation is naught.

CCC should make a bootable copy, but you'll need to test this rigorously. it should work for OSX server also.

i prefer the intimate details of the cloner's ditto commands, which i can compensate for any changes in the backup source tree.

e.g., here are the intimate details of CCC minus the uchg business:

http://home.mindspring.com/~bduart/dittoBackup.sh.sit

regarding the uchg business, the ditto command will gak on locked files. CCC will examine and unlock locked files, i believe. i've taken care of that wholesale on my boot volume, and i don't [x] lock files, so i don't have to worry about it.

i would prefer the psync solution in that it is incremental, but i have not had time to test it.

gordo, you'll need to do a little more digging to get a comfortable, optimal solution for your needs. we can keep going here, but you'll need to re-evaluate your requirements and repost them as you get closer to your optimal target operation.

hschickel
03-27-2002, 05:26 PM
merv,

Good point on locked items and ditto. Its very important to unlock before you start. Earlier versions of CCC did not unlock volumes; the latest version may. I always do it manually though so I have not tested this.

sudo chflags -R nouchg /VolumeToBeUnlocked

will recursively unlock a volume.

Hugh

gordo019
03-27-2002, 06:11 PM
Thanx for all the posts and feedback.

mervTormel
03-27-2002, 06:39 PM
hugh, others, i have just incorporated

sudo chflags -R nouchg /

at the top of my ditto script to unlock all uchg-flagged files on the boot volume before running the backups in case any lockies creep in there.

also, of note, is that if you don't start that ditto script with a clean target, ditto will supplement it. that is, existing files will be overwritten, and files that have been deleted/renamed on the source volume will remain on the target volume. right?

the uchg flag is a user level lock. it should probably be noted that there is also a schg flag (system immutable, which has to do with running a high security filesystem) that could get set on a file. i would rather see this flag cause an error in my ditto script so i could investigate the file, than wholesale unset the schg flag.

i realize that this could be getting tedious and that some of these issues have been covered elsewhere, but i want gordo to appreciate the magnitude and nuances of his request.

that is, backups are not to be taken lightly, need monitoring and testing for all these little "gotchas" that can creep in. a set and forget backup could be unusable as restored unless we get intimate with the details.

at this point, backups prolly need some babysitting. i would like to get to the point where i have rock-solid daily incrementals, and weekly full backups going off automatically, reporting to me any exceptions or anomalies that pop up. that is an ongoing project that some of us are collaborating on (whether we know it or not).

hschickel
03-27-2002, 07:12 PM
merv,

On schg - to the best of my knowledge this can only be unset while in single user mode.

On ditto - I like to erase the target before beginning as there seem to be a lot of intricacies to the way ditto fills in files. I'm expecting a boot version of OS X.1.3 in the mail from Apple any day now and I'm going to play around with how a "clean" reinstall fills out /Applications. I think ditto could be useful for this purpose. I'll let you know what I find.

On the rest - I'm very excited that Retrospect is finally released. I'm hopeful that this will put a number of the problems mentioned to bed for most users.

Hugh

mervTormel
03-27-2002, 07:57 PM
thanks, hugh,

yep. schg needs to be unset at single user. it can be set in other run modes.

$ touch foo

$ sudo chflags schg foo

$ /bin/ls -lo foo
-rw-r--r-- 1 merv wheel schg 0 Mar 27 16:31 foo

$ sudo chflags noschg foo
chflags: foo: Operation not permitted

re: the way ditto fills in files; yeah, robh and i went thru some testing of this issue and while court is still out, confidence is high on ditto integrity.

i just received OSX 10.1.3 install from ADC, and am curious if i can trash
/System and /Library and reinstall. will report. hugh, you may be interested in exploring the 'lsbom' command. it will list the dirty details of a 'bill of materials' file, like those in /Library/Receipts , which should reflect exactly what was laid down (bom is the feed to install post-processing, i believe). that is how Larry Prall's excellent chkstuff-chkUGM script works to put your ownership/permissions back together. questions? just ask.

i've been a fan of retrospect in the past, but lost confidence when they couldn't quickly deal with this UNIX file ****-data, and support for my questions went unanswered. i'm taking a 'wait and see' approach about the new product. let someone else be a gamma-tester for a while.

presently, i'm still more inclined to have an automated psync roll-yer-own solution. if anything, for the intimacy i require with my filesystem data. while i am the last to program such an approach, i am the first to suppport it.

hschickel
03-28-2002, 01:51 PM
i just received OSX 10.1.3 install from ADC, and am curious if i can trash /System and /Library and reinstall.

I would give this a qualified yes. For a stock system you should be able to trash everything (easiest way would be booted in FTDM from another OSX machine) except:

/Applications (Mac OS9)
/System Folder
/Documents
/Users
/Library*
/Applications.old - (/Applications w/ name changed minus all Apple supplied apps)

After trashing everything else I would run disk first aid; reinstall; upgrade; and then ditto -rsrc the applications from /Applications.old to /Applications.

This is something I'm planning to test over the next few days. I'm curious how ditto will handle /Applications/Utilites. I think that may have to be handled seperately depending on how ditto handles different levels of recursion.

*on /Library - I really think this should be kept around as most of the system wide user changes are stored here. Note that the receipts folder may need to be modifed for upgrades (this needs to be tested.)

Note - fink users should also hold onto /sw and /usr/X11R6.

Note2 - users with multi-user systems or certain fink installs will want to backup and replace /var/db/netinfo in addition to the items noted above.

Hugh