Rsync with --delete but don't want to delete symbolic links at destination

Using rsync, my source directory has several files and directories. My destination is already synchronized, so it displays files and directories.

However, I manually created a symbolic link at my destination, which does not exist in my source.

I need to use the -delete operation in rsync. Is there a way to make rsync not delete the symlink?

+5
source share
2 answers

You cannot achieve this, as you suggested, but the easiest solution to the described problem is to simply add the symbolic link file names to the excs rsync template

like: --exclude="folder/symlinkname1" --exclude="folder/symlinkname2"

, script bash ...

+4

? , --keep-dirlinks.

-1

All Articles