Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

My source folder contains only symbolic links to different directories:

symlink1 -> /path/to/dir1

symlink2 -> /path/to/dir2

I want rsync to delete synch'd links from the source on success. I tried adding --copy-links to follow symblinks and --remove-source-files to remove them.

rsync -vrhuz --copy-links --remove-source-files --progress -e ssh username@remotehost:/path/containing/links /local/path

Unfortunately this will delete the files linked by the symbolic links instead of the symbolic links themself, which is I want to achieve.

Any suggestions, maybe using other techniques if rsync alone is not enough?

share|improve this question

migrated from stackoverflow.com Mar 27 '13 at 23:25

This question came from our site for professional and enthusiast programmers.

add comment

1 Answer 1

You could use --links instead of --copy-links, it will remove symlinks (not referenced links), but it will sync symlinks, not referenced directories.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.