[Novalug] replacing MAC server with linux
James Ewing Cottrell 3rd
JECottrell3@Comcast.NET
Thu Aug 26 10:46:36 EDT 2010
s/Nice/Better than nothing/.
There is a big whole left by the "ignore symlinks" line (test -h $file
&& continue) and each file is processed
separately. In fact, why not just modify the old "tar piped to tar"
pattern by introducing ssh?
tar -C /src/path -cf - . | ssh remote tar -C /dst/path -xf -
ought to do nicely. Add your favorite compression, verbosity, or
substitute cpio if you like.
JIM
On 8/20/2010 7:39 PM, Mark Caudill wrote:
> Nice. I've never thought to do a recursive shell script before.
>
> On Aug 20, 2010, at 1:08 PM, James Ewing Cottrell 3rd wrote:
>> + Perhaps you can write a shell script to copy them over, something like:
>>
>> #! /bin/sh
>> cd $1
>> ls | while read file
>> do
>> test -h $file && continue
>> if test -d $file
>> then $0 $1/$file
>> else cat $file | ssh host "cat > $1/$file"
>> fi
>> done
>
> --
> flakblas | flakblas@me.com <mailto:flakblas@me.com> |
> http://omgwtfrofl.com
> War is peace. Freedom is slavery. Ignorance is strength.
> --George Orwell (1984)
>
>
>
> No virus found in this incoming message.
> Checked by AVG - www.avg.com
> Version: 9.0.851 / Virus Database: 271.1.1/3084 - Release Date: 08/20/10 14:35:00
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.firemountain.net/pipermail/novalug/attachments/20100826/c49fe545/attachment.htm>
More information about the Novalug
mailing list