반응형
단일 파일을 RSYNC하는 방법은 무엇입니까?
현재 나는 다음 Directories
과 같이 RSync-ing합니다 .
* * * * * rsync -avz /var/www/public_html/images root@<remote-ip>:/var/www/public_html
그래서 rsync
하나의 단일 파일은 /var/www/public_html/.htaccess
어떻게합니까?
디렉토리와 동일한 방식으로 수행하지만 파일 이름의 전체 경로를 소스로 지정합니다. 귀하의 예에서 :
rsync -avz /var/www/public_html/.htaccess root@<remote-ip>:/var/www/public_html/
기본 구문
rsync options source destination
예
rsync -az /var/www/public_html/filename root@<remote-ip>:/var/www/public_html
Michael Place의 답변은 소스 및 대상의 루트 디렉토리에 비해 파일 경로의 모든 디렉토리가 이미 존재하는 경우 훌륭하게 작동합니다.
그러나 파일을이 소스 경로와 동기화하려면 어떻게해야합니까?
/ source-root / a / b / 파일
다음 대상 경로가있는 파일에 :
/ target-root / a / b / 파일
그리고 디렉토리 a 와 b 가 존재하지 않습니까?
다음과 같은 rsync 명령을 실행해야합니다.
rsync -r --include="/a/" --include="/a/b/" --include="/a/b/file" --exclude="*" [source] [target]
참고 URL : https://stackoverflow.com/questions/14888012/how-to-rsync-a-single-file
반응형
'Programing' 카테고리의 다른 글
Mathematica : 기호 프로그래밍이란 무엇입니까? (0) | 2020.10.12 |
---|---|
JavaScript를 사용하여 동적으로 링크에 "href"속성을 추가하려면 어떻게해야합니까? (0) | 2020.10.12 |
느린 뷰 렌더링의 원인 진단 (0) | 2020.10.12 |
build.gradle의 local.properties에 정의 된 속성을 읽는 방법 (0) | 2020.10.12 |
"if"문에서 변수 초기화 (0) | 2020.10.12 |