rsync 파일 - 질문에서

rsync 파일 - 질문에서
rsync -av --files-from=list.txt A/* B/

list.txt에는

A/text1.txt

명령을 실행할 때 매뉴얼 페이지를 참조할 때 오류가 발생합니다. 이유를 아는 사람이 있습니까?

전체 설명서는 rsync(1) 및 rsyncd.conf(5) 매뉴얼 페이지를 참조하십시오.http://rsync.samba.org/업데이트, 버그 보고 및 답변 rsync error: options.c(854)의 구문 또는 사용 오류(코드 1)

답변1

명령줄과 파일에 디렉터리를 포함하고 와일드카드를 사용하면 rsync를 혼동할 수 있습니다. 이는 귀하의 요구 사항에 더 적합할 수 있습니다.

$ cat lists.txt 
text1.txt

$ ls A
text1.txt  toskip.txt

$ rsync -av --files-from=lists.txt A/ B/
building file list ... done
created directory B
text1.txt

sent 89 bytes  received 31 bytes  240.00 bytes/sec
total size is 0  speedup is 0.00

$ ls B
text1.txt

따라서 lists.txt디렉터리는 포함되지 않고 파일 이름만 포함되며 소스 디렉터리는 명령줄에 지정됩니다 A. 파일에 나열된 파일만 복사 lists.txt하고 다른 파일은 건너뛰는 것을 볼 수 있습니다.

관련 정보