RAID and Adaptec AAA131

Monty Harder lists at kc.rr.com
Mon Jul 23 03:33:23 CDT 2001


7/17/01 8:16:47 AM, "Eric Rossiter" <rossiter at discoverynet.com> wrote:

>Morning Lugites,
>
>Someone posted a message the other day about how they mirror one drive on
>another using a simple shell script.  Seems I have inadvertently deleted it.

  I used to do this at work on a Windows network, and it goes like this:

	XCOPY /S /M  \server1sharename*.*  \server2sharename*.*

  The first time, you leave the /M(odified) switch off, or run a command to set all files to 
"dirty".  The same 
functionality can be accomplished in *nix by capturing the current date and time in a small file to 
keep track of the 
cutoff time of the last backup.  I admit my shell scripting skills aren't as good as my DOS/Win 
Jedi Batch Trick abilities, 
but (having not tested this) I believe the equivalent is:

	cp -u -R   _source_   _destination_

  This doesn't work =exactly= the same, because TTBOMK ext lacks the "archive" attribute.  The -u 
switch does a fair job of 
emulating it, though:  If the destination has the same or newer Last Modified time, the file is not 
copied.  This approach 
has the advantage over the XCOPY variant that the exact same shell command both creates and updates 
the mirror, including 
rebuilding any files you've deleted from the mirror.  In fact, you can issue this command both 
directions to make sure that 
files deleted from either system are restored. (Which brings up the question of how you =delete= 
files from the mirror that 
have left the primary, and you're sure you want them gone - I'd be careful about spool and log 
directories, frex.)

  OTOH, you can use the /M approach with different destination paths per day of week, etc. to build 
up a history of 
versions of files, just as you get from tape backups.  If you really want that kind of flexibility, 
though, it would 
probably be easiest to use tar instead.




More information about the Kclug mailing list