I have an rsync command which I'm using to synchronise two directories:

rsync -CurvtOlon --delete /home/source/path/ /home/dest/path/

When I run the command, it recursively scans all of the source tree and finds me all of the files and directories which need updating in the destination tree. When I remove the -n option and actually run the command, it synchronises all of the files and directories as I'd expect, but when I run the command again immediately afterwards it tells me that the files are now up-to-date, but all of the directories still need updating.

I either need to understand why it's not updating the directories properly and still marking them as out-of-date, or I need a new command to compare only files and not directories.

I thought I could try to exclude everything and then include just the file extensions that I know I need, but this seems to prevent it from even looking in directories to find the files in the first place:

rsync -CurvtOlon --delete --include="*.txt" --exclude="*" /home/source/path/ /home/dest/path/

Any suggestions very welcome!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.