[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

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



On Mon, 2008-10-27 at 14:39 -0700, Peter Langfelder wrote:
> On Mon, Oct 27, 2008 at 12:26 PM, Linuxguy123 <linuxguy123 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.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]