Re: Need help with simple scripting using rcp

From: AUBINEAU Cyril (caubineau@SIGMA.FR)
Date: Wed Aug 07 2002 - 10:56:53 EDT


Hello Ken,

Try:

find /u14 -type f| awk -v DEST=H50 -v EXCLU_DIR=common ' BEGIN {FS="/"}
                {copy="yes"
                 for (i=0;i<NR-1;i++)
                        {if ($i==EXCLU_DIR)
                                {copy="no"}}
                 if (copy=="yes") {printf "rcp -rp %s %s:%s\n",$0,DEST,$0}}'
| ksh

Hope it helps.

Cyril

> -----Message d'origine-----
> De: Ken_Sedlacek@KYRUS.COM [SMTP:Ken_Sedlacek@KYRUS.COM]
> Date: mercredi 7 août 2002 16:06
> À: aix-l@Princeton.EDU
> Objet: Need help with simple scripting using rcp
>
> Than you to those who previously posted an answer to my question of how to
> exclude a directory from xfering files from an H70 to an H50.
>
> Can I use your scripting knowledge again??
>
> Here is what we have come up with so far:
>
> 1) H70#: find /u14 -name common -prune -o | tar -cvf ./H50u14files
>
> 2) then, manually ftp the tar to H50.
>
> 3) then on H50 tmp: tar -xf H50u14files /u14
>
> Can anyone make this one command using rcp?
> (what we are trying to accomplish: move files from H70 /u14 fs minus
> "common" directory to our H50 /u14 fs)
>
> Make it better??
>
> TIA
>
>
> Ken Sedlacek
> AIX/TSM/UNIX Administrator
> ksedlacek@kyrus.com
>
> IBM Certified Specialist: RS/6000 AIX v4.3 Support
> IBM Certified Specialist: RS/6000 SP & PSSP 3
> Tivoli Certified Consultant - Tivoli Storage Manager v4.1



This archive was generated by hypermail 2.1.7 : Wed Apr 09 2008 - 22:16:07 EDT