Hello, list Rsync is a amazing tools for files and directories syncing. There is something unclearly to me. I digged in the web for a while, but there aren't useful things for me. Here is my puzzle: I want to sync one big directory from one host to a remote host. And there are several symbolic links which linked to some files and directories that outside the certain directory. I want to copy the symbolic links as real file or directory. For example: The host A: -rw-r--r-- 1 wangpenghui wangpenghui 0 2006-11-13 09:14 aa -rw-r--r-- 1 wangpenghui wangpenghui 0 2006-11-13 09:14 ab -rw-r--r-- 1 wangpenghui wangpenghui 0 2006-11-13 09:14 ac lrwxrwxrwx 1 wangpenghui wangpenghui 6 2006-11-13 09:14 ad -> /tmp/b After the syncing, The host B should looks like: -rw-r--r-- 1 wangpenghui wangpenghui 0 2006-11-13 09:14 aa -rw-r--r-- 1 wangpenghui wangpenghui 0 2006-11-13 09:14 ab -rw-r--r-- 1 wangpenghui wangpenghui 0 2006-11-13 09:14 ac drwxr-xr-x 1 wangpenghui wangpenghui 6 2006-11-13 09:14 ad The directory ad should be the real folder of the old /tmp/b I have tried some parameters of the command rsync. But no result too. Every response will be appreciated. Wang, -- Wang Penghui +86 592 8389 650 -------------- next part -------------- HTML attachment scrubbed and removed
Wayne Davison
2006-Nov-13 07:04 UTC
copy symbolic links as real file during syncing files.
On Mon, Nov 13, 2006 at 09:17:16AM +0800 you wrote:> I want to copy the symbolic links as real file or directory.Use -L (--copy-links) to transform symlinks into the referent file. ..wayne..
John Van Essen
2006-Nov-13 07:13 UTC
copy symbolic links as real file during syncing files.
On Mon, 13 Nov 2006, <wangpenghui@gmail.com> wrote:> > I want to sync one big directory from one host to a remote host. > And there are several symbolic links which linked to some files > and directories that outside the certain directory. I want to > copy the symbolic links as real file or directory.The rsync man page describes this option: -L, --copy-links When symlinks are encountered, the item that they point to (the referent) is copied, rather than the symlink. In older versions of rsync, this option also had the side-effect of telling the receiving side to follow symlinks, such as symlinks to directo- ries. In a modern rsync such as this one, you'll need to spec- ify --keep-dirlinks (-K) to get this extra behavior. The only exception is when sending files to an rsync that is too old to understand -K -- in that case, the -L option will still have the side-effect of -K on that older receiving rsync. If you are using rsync as a daemon, then be aware that if any of the symlink targets are outside of the module's path, you must declare "use chroot = no" for that module. John