1

I want to use rsync to make a copy of a folder that contains symlinks to other files in the same folder. Is it possible to get updated symlinks -pointing to absolute paths- in the destination?

I mean, having this in the source folder:

source
├── file1
└── subfolder
    └── symlink2file1 -> /absolute/path/to/source/file1

I want in the destination folder:

destination
├── file1
└── subfolder
    └── symlink2file1 -> /absolute/path/to/destination/file1

I need this behaviour because eventually I may remove the source folder.

1

Unfortunately it is not possible to automatically update absolute symlink targets with rsync.

A possible solution would be to convert absolute symlinks to relative symlinks in your source folder. You can check this thread for how to do so.

| improve this answer | |

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.