I have the following scenario where I need to copy directories which sometimes can be links and sometimes a directory with the same name. For instance, suppose this is the initial setup:
Source: /workspace/test/source/dir1 -> /tmp/test1
Destination: /workspace/test/dest/dir1 -> /tmp/test1
Now, suppose I remove the link in the source and create a folder with the same name, so now it looks like this:
Source: /workspace/test/source/dir1
Destination: /workspace/test/dest/dir1 -> /tmp/test1
What I'd like to do now, is to use rsync to copy the actual folder and "overwrite" the link, so it would look like:
Source: /workspace/test/source/dir1
Destination: /workspace/test/dest/dir1
Is there any way to do it via rsync? I know that if I use the rsync one level above, ie /workspace/test/source, it will work. Unfortunetly, I have to use the lowest level rsync.
Appreciate your response.