Search code examples
symlinkrsync

Rsync symlinked content


I use rsync to upload websites to a server. I use it something like this:

rsync -auvzhL . username@host:/home/username/foldername

I only want to update things that are newer on my computer, and not to delete things on the server that I don't have.

This all worked fine, until I decided to symlink some files in the folder to other ones. Now if I change that file, it doesn't get included in rsync unless I delete and recreate the symlink. Assumedly because the symlink date is the creation of the link, not the content.

Is there anyway to either force rsync to always copy certain files, or, better, update the modified date on a symlink without deleting and recreating it?


Solution

  • In the end I just delete and recreate all the symlinks before rsyncing. I'm sure there is a better way, I just can't work it out!