How do I do a selective, recursive copy ? Bash script ?

Linuxguy123 linuxguy123 at gmail.com
Mon Oct 27 19:46:26 UTC 2008


On Mon, 2008-10-27 at 14:39 -0700, Peter Langfelder wrote:
> On Mon, Oct 27, 2008 at 12:26 PM, Linuxguy123 <linuxguy123 at gmail.com> wrote:
> >
> > I want to preserve the directory structure. I feel a script coming on.
> > Am I right ?
> 
> Look at the man page for rsync. Basically a command like
> 
> rsync -avu --exclude='*.flac' oldDir/ newDir/
> 
> should do what you want, that is copy the contents of oldDir into
> newDir preserving the directory structure, and it'll preserve
> ownership and timestamps as well.

That does help.  Thanks, Peter.   I knew about rsync as I used it once,
but I didn't realize it could exclude files.   Great tip.




More information about the fedora-list mailing list