There are various similar questions here, but I don't think any of them quite answer this.
I have a local directory (www) which has to be mirrored exactly on a remote server, and I need to confirm that they're exact copies.
www contains symlinks to other files inside www (the links are to both regular files and directories). This command will compare the two versions of www, excluding local svn directories as a bonus, and print only the different files:
[local]$ rsync -rvnc --exclude=.svn/ --delete www/ remote:/var/www/ But it doesn't follow symlinks, and just reports that they're not regular files. So, I need to dereference the symlinks, and compare their targets. Neither rsync -rvncL nor rsync -rvncK does this - -L prints out lots of files that don't differ (that I can see, anyway), and -K is doing nothing. Any ideas?
www, the symlink targets themselves will (eventually) get copied independently of the symlinks. So they'll get checked as and of themselves, leaving the symlinks simply pointing to guaranteed-copied files. (In other words I don't think you need to worry - yourrsynccommand is already doing the right thing.)localcould point to file A, while the same symlink inremotecould point to file B, which should be flagged as a failure. Not very likely, but I'd feel a lot better if I could actually check it, and dereferencing the symlink would do the check.