Monday, June 22, 2015

bash copy a directory recursively, excluding some directory or file name

rsync -av --progress sourcefolder /destinationfolder --exclude thefilenametoexclude
rsync -av --progress sourcefolder /destinationfolder --exclude thefoldertoexclude
 
NOTE: if the filename or directory appear multiple times, they will be excluded multiple times

Src:http://stackoverflow.com/questions/4585929/how-to-use-cp-command-to-exclude-a-specific-directory 

No comments:

Post a Comment