RE: [SLUG] Cp -R skipping some directories
Thanks all, seems like rsync is what I have been looking for. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Julio Cesar Ody Sent: Fri, 27. May 2005 2:21 PM To: [EMAIL PROTECTED]; slug Subject: Re: [SLUG] Cp -R skipping some directories Well, that depends on what we're talking about. In a script context, you could have an "ignore list", and by checking if "folder1" is in it, the script would that folder and move on. (insert your favorite shell hack here) But strictly as a command, you have regexes available. By copying "ma*" recursively to, say, "/tmp", you'll copy folders like "man", "mate", or whatever else starts with "ma". On 5/27/05, Simon <[EMAIL PROTECTED]> wrote: > HI all, > Is it possible to have cp skip some directories when using cp -R? > > > OLMC > Simon Bryan > IT Manager > [EMAIL PROTECTED] > LMB 14 > North Parramatta > tel: 96833300 > fax: 98901466 > mobile: 0414238002 > > > -- > SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/ > Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html > -- Julio C. Ody http://rootshell.be/~julioody -- SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/ Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html _ << ella for Spam Control >> has removed Spam messages and set aside Later for me You can use it too - and it's FREE! www.ellaforspam.com -- SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/ Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html
Re: [SLUG] Cp -R skipping some directories
Simon, Is it possible to have cp skip some directories when using cp -R? Dunno, but cpio -p would be able to solve your problem. $ find . -print | cpio -pdmuv /new/directory Find simply generates a list of file names, which cpio reads on it's standard input as a list to copy. Obviously you can put any filter you like between find and cpio, but you can also use anything to create the list to feed to cpio. $ find . -print | egrep -v '(not-this|nor-that)' | cpio -pdmuv /new/directory $ cat my-list-of-files | cpio -pdmuv /new/directory HTH P. -- SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/ Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html
Re: [SLUG] Cp -R skipping some directories
From: "Simon" <[EMAIL PROTECTED]> Date: Fri, 27 May 2005 14:08:37 +1000 > Is it possible to have cp skip some directories when using cp -R? mirrordir command can help you. -- SEKINE Tatsuo -- SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/ Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html
Re: [SLUG] Cp -R skipping some directories
Well, that depends on what we're talking about. In a script context, you could have an "ignore list", and by checking if "folder1" is in it, the script would that folder and move on. (insert your favorite shell hack here) But strictly as a command, you have regexes available. By copying "ma*" recursively to, say, "/tmp", you'll copy folders like "man", "mate", or whatever else starts with "ma". On 5/27/05, Simon <[EMAIL PROTECTED]> wrote: > HI all, > Is it possible to have cp skip some directories when using cp -R? > > > OLMC > Simon Bryan > IT Manager > [EMAIL PROTECTED] > LMB 14 > North Parramatta > tel: 96833300 > fax: 98901466 > mobile: 0414238002 > > > -- > SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/ > Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html > -- Julio C. Ody http://rootshell.be/~julioody -- SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/ Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html
Re: [SLUG] Cp -R skipping some directories
Simon wrote: HI all, Is it possible to have cp skip some directories when using cp -R? I don't think so. Looked into it just the other day. I think find is your friend or start copying from deeper down the tree? -- SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/ Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html
Re: [SLUG] Cp -R skipping some directories
On Fri, 27 May 2005 14:08:37 +1000, Simon uttered > HI all, > Is it possible to have cp skip some directories when using cp -R? You can. Except just cp -R won't cut it. The one way that springs to mind is using find with -prune and -exec cp {} \; Cheers, -- Steve C offers you enough rope to hang yourself. C++ offers a fully equipped firing squad, a last cigarette and a blindfold. - Erik de Castro Lopo -- SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/ Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html
[SLUG] Cp -R skipping some directories
HI all, Is it possible to have cp skip some directories when using cp -R? OLMC Simon Bryan IT Manager [EMAIL PROTECTED] LMB 14 North Parramatta tel: 96833300 fax: 98901466 mobile: 0414238002 -- SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/ Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html