티스토리 뷰

  • Rsync를 수행하다 보면 'file has vanished' 오류가 발생할 경우가 있다.
  • 전송 중에 파일이 사라졌다는 내용인데요.
  • 무시해도 되는 건데 자꾸 에러로 노출이 된다는것입니다.
  • 이를 무시하기 위한 방법을 설명합니다.

 

2가지 방법이 있습니다.

Version 업그레이드 ( > 3.2.4)

  • https://download.samba.org/pub/rsync/NEWS#3.2.4 에서 추가됨
  • Transformed the atomic-rsync script into a python script and added the ability to ignore one or more non-zero exit codes. By default, it now ignores code 24, the file-vanished exit code. (See the support dir.)

rsync wrapper 사용

ignore "vanished files" warning
Some folks would like to ignore the "vanished files" warning, which manifests as an exit-code 24. The easiest way to do this is to create a shell script wrapper. For instance, name this something like "rsync-no24":

#!/bin/sh
rsync "$@"
e=$?
if test $e = 24; then
    exit 0
fi
exit $e
  • /usr/local/bin 에 넣어주면 되는데, 주의할게 이름을 rsync로 동일하게 주면 무한루프가 발생할 수 있다.
  • 따라서 위 스크립트에서 명시적으로 절대 경로를 지정해주자.   (또는, 위 스크립트로 하되, 파일명을 다르게 e.g. rsync-wrapper)

 

#!/bin/sh
/usr/bin/rsync "$@"
e=$?
if test $e = 24; then
    exit 0
fi
exit $e
댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
«   2024/05   »
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31
글 보관함