Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I want to rsync dirs includes files from path to another exact path that has been rsynced from it

For example :-

path 1 have

dir1/
dir1/mysql
dir1/log1
dir1/log2
dir1/log3
dir1/home

want to rsync mysql and home directories only but will be rsync with the same path name

so the result in the rsync place

dir1/
dir1/mysql
dir1/home

hope someone help me with the right rsync comand

share|improve this question

migrated from stackoverflow.com Jul 20 '12 at 1:55

This question came from our site for professional and enthusiast programmers.

add comment

1 Answer

Something like this?

rsync -av  origin/{home,mysql} destination/
share|improve this answer
    
what if home into another directory no mysql and home under same directory ? like dir1/dir2/home and mysql will be dir1/mysql –  iLinux85 May 19 '12 at 15:25
    
you can nest {d1,d2{dx,dy}} as you like. If things become too complex you can put directories in a text file and use --files-from=whattorsync.list or call rsync multiple times from a script. –  dschulz May 19 '12 at 15:54
    
sorry the main command you post didn't rsync the home and mysql directories –  iLinux85 May 27 '12 at 9:11
    
sorry, I assumed your shell is bash. –  dschulz May 27 '12 at 17:19
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.