On Wed, 2002-03-20 at 17:20, Scott Ragen wrote:
> Hi guys,
> Just have a question about copying files from one directory to another with
> some soft of exclusion string.
> What my goal is, I want to backup all data from one directory in a
> filesystem to another file system except ???????G.DAT and ???????Z.DAT (the
> ??????? can be replaced with a * if necessary but not preferred)
> I can do it with the "for i in" command, but is there an easier less
> stressful way?
> There is about 7-8 gig of data in total, (4 gig needed to be copied), and
> approx 6000 files (4000 of which would need to be copied).
> 

cp ???????[A-FH-Y].DAT /new/dir
find . -print | egrep -v "G.DAT$|Z.DAT$" | cpio -oac | bzip > newfile
find . -print | egrep -v "G.DAT$|Z.DAT$" | cpio -pvdm /new/dir

These should all work but will need customising to your exact
requirements, feel free to drop me a line off list to discuss it.

Greeno
-- 
Tony Green <[EMAIL PROTECTED]>
Tel       :   +61-(0)2-9500-9996    
Mobile    :   +61-(0)4-2521-9996    
GnuPG Key :  1024D/B5657C8B
Key fingerprint = 9ED8 59CC C161 B857 462E  51E6 7DFB 465B B565 7C8B

-- 
SLUG - Sydney Linux User Group Mailing List - http://slug.org.au/
More Info: http://lists.slug.org.au/listinfo/slug

Reply via email to