0

I'm trying to accomplish a very simple goal. I'm just simply trying to sync two directories together and not having much success. I'm using the following command

rsync -avR /path/to/source/folder /path/to/destination/folder

It shows a lot of stuff in the output when I run this command (no errors), but when I go to check a file from the destination folder that I've changed in the source, the contents are still old.

Any ideas why this may be happening?

2

Since you use the -R (--relative) option the source directory hierarchy would be written to /path/to/destination/folder/path/to/source/folder.

To make /path/to/destination/folder a copy of /path/to/source/folder, use

rsync -av /path/to/source/folder/ /path/to/destination/folder

Note that I removed the -R option and that I also added a / to the end of the source path. Without the / at the end of the source path, the source directory would have been copied as /path/to/destination/folder/folder.

Add --delete to the command if you wish to remove files not existing in the source path. (When experimenting, always use copies of data, or data that is properly backed up!)

Your Answer

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

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