rsync가 특정 파일을 복사하거나 복사하지 않는 이유 진단

rsync가 특정 파일을 복사하거나 복사하지 않는 이유 진단

rsync원격 서버에서 파일을 가져온 다음 처리하는 데 사용하는 스크립트가 있습니다 . 이러한 로컬 복사본은 실행 간에 삭제되지 않으므로 rsync가져와야 합니다 .새로운파일. 그러나 캐시된 로컬 복사본이나 서버 복사본이 변경되지 않은 경우에도 매번 모든 파일을 다운로드하는 것 같은데 rsync이유를 알 수 있습니다.

rsync이번 실행에서 특정 파일이 복사되거나 복사되지 않는 이유를 진단하는 데 도움이 되는 명령줄 인수가 있습니까 ? 시도했지만 -v필요한 정보를 제공하지 못하는 것 같습니다. 다음과 같은 것 :

> rsync --diagnose-why-files-copied remotehost:/remote/path ./local/path/
'remotehost:/remote/path/file1':
  Destination file './local/path/file1' does not exist; copying.

'remotehost:/remote/path/file2':
  Destination file './local/path/file2' exists...
  Destination file size does not match source file size; copying.

'remotehost:/remote/path/file3':
  Destination file './local/path/file3' exists...
  File sizes match...
  Destination file modification date does not match source file modification date; copying.

'remotehost:/remote/path/file4':
  Destination file './local/path/file4' exists...
  File sizes match...
  File modification dates match...
  No change detected; skipping.

> rsync -c --diagnose-why-files-copied remotehost:/remote/path2 ./local/path2/
'remotehost:/remote/path2/file1':
  Destination file './local/path2/file1' does not exist; copying.

'remotehost:/remote/path2/file2':
  Destination file './local/path2/file2' exists...
  Destination file checksum does not match source file checksum; copying.

'remotehost:/remote/path2/file3':
  Destination file './local/path2/file3' exists...
  File checksums match...
  No change detected; skipping.

답변1

-ii내가 찾고 있던 것입니다. --itemize-changes약식 옵션을 사용하면 업데이트 -i되거나 변경된 각 파일에 대해 해당 파일에 대해 수행된 작업과 이유를 식별하는 진단 메시지가 인쇄됩니다. 옵션을 두 번 지정하면 전혀 변경되지 않은 파일에 대한 메시지도 인쇄됩니다.

관련 정보