Search code examples
rsync

Using rsync to dereference symlinks in shadow directories


I have one common project folder with one base code that I'll be using for different platforms. What I have done is create "shadow" directories using "lndir". when I try to run an rsync script to dereference the symlinks in my shadow directories and copying them to a new folder in a new destination using...

"rsync –pvtrlL –cvs-exclude projectdirectory/* ../projectdirectorydestinationfolder/"

I get the following error...

"rsync error: some files could not be transferred (code 23) at /SourceCache/rsync/rsync-42/rsync/main.c(992) [sender=2.6.9]"

Only the destination folder is created but has zero contents. When I cd back one directory and run the same command as above, the output has skipped several directories within my project directory and these directories are the shadow directories I have created using the lndir command.

Any idea where I am going wrong?


Solution

  • Rats! It's the little things that can make such a big difference! Would you believe there was a missing "-" in the rsync script?

    It should have been

    rsync --cvs-exclude projectdirectory/* ../projectdirectorydestinationfolder/
    

    instead of

    rsync –cvs-exclude projectdirectory/* ../projectdirectorydestinationfolder/
    

    I added the missing dash in front of "cvs" and it worked!