1

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?

1 Answer 1

-1

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

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.