Would it be possible with rsync to adapt the absolute, symbolic links to a new location at the destination?
Test case
Imagine I have a link pointing to a file like this:
/usera/files/common/test_file
/usera/files/common/links/test_link -> /usera/files/common/test_file
Now I would like to rsync the whole directory common
to another location. (group permissions are adapted, look below why)
rsync -av --no-g /usera/files/common/ /userb/common
That gives me:
/userb/common/test_file
/userb/common/links/test_link -> /usera/files/common/test_file
The problem
The problem is that the group on the destination is different than on the source (security reasons), so that the test_link
does not point to /userb/
space but rather to /usera/
and therefore is not readable for this user.
Question
Would it be possible to tell rsync to adapt the links below the syncing point (/common/
here) to fit to the new destination? That would give a link as such:
/userb/common/links/test_link -> /userb/common/test_file
I tried following the solution to a similar problem, however it does not seem to do what I want..
Thanks!