rsync 비ASCII 문자

rsync 비ASCII 문자

저는 rsync를 사용하여 웹사이트 파일을 백업하고 --link-dest를 사용하여 이전 rsync 백업에서 복사하고 있습니다.

rsync -zavx -e 'ssh -p22' \
   --numeric-ids \
   --delete -r \
   --link-dest=../"$latest_backup" "$rhost:$rhost_source" "$local_dest";

ASCII가 아닌 문자가 포함된 파일은 문자가 변환된 것으로 보이므로 rsync가 해당 문자를 제거한 다음 다시 다운로드합니다.

예는 다음과 같습니다.

deleting public_html/images/made/96096a4645d59a3e/Moulin_a?\#200_vent_Bourgogne_DBW1901_680_680_s_c1.jpg

public_html/images/made/96096a4645d59a3e/Moulin_à_vent_Bourgogne_DBW1901_1200_801_80.jpg

rsync가 문자를 변환하는 것을 방지할 수 있습니까?

답변1

을 사용해야 합니다 --iconv.

매뉴얼 페이지에서https://linux.die.net/man/1/rsync

--iconv=CONVERT_SPEC 
 Rsync can convert filenames between character sets using this option. 
 Using a CONVERT_SPEC of lq.rq tells rsync to
 look up the default character-set via the locale setting. Alternately,
 you can fully specify what conversion to do by giving a local and a
 remote charset separated by a comma in the order --iconv=LOCAL,REMOTE,
 e.g. --iconv=utf8,iso88591. This order ensures that the option will
 stay the same whether you're pushing or pulling files. Finally, you
 can specify either --no-iconv or a CONVERT_SPEC of lq-rq to turn off
 any conversion. The default setting of this option is site-specific,
 and can also be affected via the RSYNC_ICONV environment variable.

관련 정보