MLUG: RE: [MLUG] cp -R --skip [pattern]?
RE: [MLUG] cp -R --skip [pattern]?
Email address obfuscation in effect -- please click here to turn it off.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
> I have a directory tree with MP3 files in it, but there also are HTML 
> files (album reviews) and JPEG files (album covers).  I would like to 
> replicate that directory tree without the MP3 files.

Hi, rsync was made for this kind of thing. The option you're looking for
is --exclude. If you man rsync, there are a ton of example incantations,
with lots of good explanations of what they do and why you'd want use
them.

Here's what I'd try, but don't take my word for it, read the man page:

rsync -navzSH --exclude "*.mp3" /path/to/source/dir/.
/path/to/target/dir/

Option 'n' is for a dry run. If it looks like the command is doing what
you want, then you're golden: rerun the same command without the 'n'.

The remaining options are a good default set of options for rsync, but
as to why, is an exercise for the reader.

--
HARDY POTTINGER <EMAIL:PROTECTED>
University of Missouri Library Systems
http://lso.umsystem.edu/~hardy/
"No matter how far down the wrong road you've gone,
turn back." --Turkish proverb

_______________________________________________
members mailing list
EMAIL:PROTECTED
http://mlug.missouri.edu/mailman/listinfo/members