Results 1 to 7 of 7
Code:
$ cd /tmp
$ echo "123" > aaa
$ echo "123" > bbb
$ echo ln -s bbb ccc
$ echo ls -la
aaa
bbb
ccc -> bbb
$ ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 09-02-2007 #1Just Joined!
- Join Date
- Sep 2007
- Posts
- 7
rsync symlinks issue
This example shows that symlink ccc was replaced with a regular file, which implies that during a remote sync the contents of the aaa will be downloaded. However, files aaa and bbb have the same content, so I need rsync to skip updating the destination file if it is a symlink that points to a file that is identical to the source file. The rsync manpage has some stuff about symlinks, but I found only arguments related to symlinks on source, not on destination. Any hints about changing rsync behaviour to suit my needs?Code:$ cd /tmp $ echo "123" > aaa $ echo "123" > bbb $ echo ln -s bbb ccc $ echo ls -la aaa bbb ccc -> bbb $ rsync aaa ccc $ echo ls -la aaa bbb ccc
- 09-03-2007 #2
I use rsync with -avrP and it preserves links, I think P is the switch that does it.
- 09-03-2007 #3
After reading this over, I don't know exactly what you're trying to do. Looks like normal behavior.
- 09-03-2007 #4Just Joined!
- Join Date
- Sep 2007
- Posts
- 7
- 09-03-2007 #5Just Joined!
- Join Date
- Sep 2007
- Posts
- 7
Heh, actually I was trying to provide a trivial example, to make the understanding easier. Here's the deal. I have two directory trees. Big ones. They have many common/identical files (relative to the roots of the trees). So I was thinking that I could save hdd space by replacing identical files in one of these directory trees with symlinks from the other tree. But the problem is each of these trees are periodically synced individually with an external source. My example was a proof that during a sync, all the symlinks will be replaced with files. That'll eat all the space again, which is a thing I want to avoid.
Feel free to ask more questions about my issue, if you're still confused.
- 09-03-2007 #6
- 06-04-2010 #7Just Joined!
- Join Date
- Jun 2010
- Location
- Near Durham, NC
- Posts
- 1
I came upon the same need: copy files from source to destination, but if it finds a link at the destination don't overwrite it if the link points to a file whose contents are the same as the source.
Couldn't find a way to do it, either. I think it's not (yet) a feature.




