[vox-tech] Suggestions....?

Ken Herron vox-tech@lists.lugod.org
Thu, 19 Jun 2003 15:51:06 -0700


--On Thursday, June 19, 2003 15:22:47 -0700 Richard Crawford 
<rscrawford@mossroot.com> wrote:

> What I need to do is replace the contents of each directory of the form
> 2a or 2b on Server II with the contents of the corresponding 2a
> subdirectories on Server I.  The trick is that none of the contents of
> the other directories can be replaced... otherwise, I'd just tar up the
> contents of DIRECTORY B on Server I and untar it on SERVER II.
>
> If it was just two or three subfolders of the form 2a and 2b on my
> server, it wouldn't be an issue.  But I've got hundreds of the little
> buggers, and I don't want to spend all day doing this.

You could look into rsync. You ought to be able to construct an rsync 
exclusion file defining the files to be ignored, though it can get tricky 
at times.

But really, it may be as simple as the following:

cd /path/to/dir-a
for dir in subdir-2/*/
do
	echo doing $dir
	tar cf - $dir | ssh server-ii 'cd /path/to/dir-a && tar xvf -'
done

then repeat for directory B.


-- 
Kenneth Herron  Kherron@newsguy.com     916-366-7338