Question : How Can I Get Rsync to Include Subdirectories?

On a MacBook running 10.6.3, I want to use rsync at the Terminal command prompt to copy everything in my Documents directory, including all subdirectories over to my external drive named "WD_External."

I issued the following command: rsync ~/Documents/*.* /Volumes/WD_External/R

However, subdirectories are not getting included.

Answer : How Can I Get Rsync to Include Subdirectories?

You don't want the *.* here, because that will leave out directories. That only copies files which match the pattern filename.extension. Be careful about using a slash or not -- if you add the slash at the end, it copies the contents of the directory. Leave out the slash, and it copies the directory itself (and everything under it with the -r or better yet the -a option.

The -a option is what most people use -- it represents a collection of other options as Woolmlikporc points out.

open terminal and type man rsync to read all about it.

Random Solutions  
 
programming4us programming4us