Linux의 심볼릭 링크

Linux의 심볼릭 링크

rsync서버에서 코드를 복사하기 위해 over 를 사용하고 있습니다 ssh.

rsync -avzhe ssh --progress  root@ecash-staging:/to/path/file /path/

복사할 수 없는 심볼릭링크 디렉터리가 있는데, 링크 대상의 내용이 필요합니다.

1) 해당 디렉토리를 복사한 다음 tar 파일을 만들어 서버에서 다운로드하거나 로컬 컴퓨터에 복사하려면 어떻게 해야 합니까?

2) 아니면 디렉터리를 로컬 컴퓨터에 직접 다운로드할 수 있나요? 그렇다면 어떻게?

답변1

구경하다 man rsync. 여기서 관련 부분은 다음과 같습니다.

SYMBOLIC LINKS
       Three  basic  behaviors  are  possible when rsync encounters a symbolic
       link in the source directory.

       By default, symbolic links are  not  transferred  at  all.   A  message
       "skipping non-regular" file is emitted for any symlinks that exist.

       If --links is specified, then symlinks are recreated with the same tar‐
       get on the destination.  Note that --archive implies --links.

       If --copy-links is specified, then symlinks are "collapsed" by  copying
       their referent, rather than the symlink.

따라서 해야 할 일은 다음 옵션을 추가하는 것뿐입니다 --copy-links.

rsync -avzhe ssh --progress --copy-links root@ecash-staging:/to/path/file /path/

관련 정보