Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I'd like to know how I can sync only existing files and directories in the target directory. For example, if I have in the source

a\, b\ , b.txt, a.txt

and in the target

a\, a.txt

Then I would like rsync to update a\ (including all files in it, on the source) and a.txt but ignore copying b\ and b.txt. Thanks for the inputs.

share|improve this question
add comment

1 Answer

Type in man rsync into the terminal to see the man page. It shows you all the options available and explains them. I think what you are looking for is

--existing              skip creating new files on receiver

so use it as option

rsync --existing
share|improve this answer
    
This does not help me. Because I do want files in the folder `a` in the above example to be created recursively. I just want to skip any files and folders being created on level 1. –  Ubuntu_kwr Mar 30 '13 at 19:10
    
I think this is easy to miss when reading your question. Maybe you could make that detail stand out a little more. –  André Stannek Mar 30 '13 at 21:48
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.