synchronization - One Way Sync and skip specific folder in Linux -


i have folder "source" following structure

source ----folder1         ----subfolder1 ----folder2         ----subfolder2         ----private ----folder3         -----subfolder4                      ----subsubfolder4         -----private 

i writing linux bash file move file found in sub directories new destination folder "destination" , create folder tree if not created in destination.

so far code doing job , reserving directory tree in both folders , deleting source file once copied

cd /source/ find * -iname "*.*" -type f -print0 | xargs -0 -i '{}' /usr/bin/rsync -avr --remove-source-files "{}" /destination/ 

my problem dont want code copy file located in folder named "private" or create private folder in "destination". want skip folder private whenever comes across it.

any idea

you can use rsync <options> --exclude private skip occurences of folder "private" , contents.


Comments

Popular posts from this blog

sql - Time in datatime field -

javascript - How to split the success output from an Ajax post? -

java - sharing object across different classes -