우분투 리눅스의 루트 폴더에 대한 미러 백업을 만들려고 거의 하루 종일 노력하고 있습니다. rsync를 설치하고 다음 내용으로 스크립트를 만듭니다.
#!bin/bash
rsync -rtvpl / /home/julian/Escritorio/copiaRsync/
가장 큰 문제는 일부 파일이 복사되고 다른 파일은 복사되지 않는다는 것입니다. 어떤 경우에는 오류, 루트로 실행중인 스크립트를 표시하고 chmod + x rsync.sh 명령으로 실행 권한을 부여했습니다. 다른 문제는 폴더를 차단하는 권한으로 복사된다는 것입니다. 백업 사본을 볼 수 있도록 일부 이미지를 첨부 한 상태로 둡니다.
What I can do? I do not know what to try so that the copy is generated exactly the same as the source files. the files of origin are not blocked and when the copy generates them to me with permissions, I do not understand.
Use the -a
option, which was invented to copy all things that most people need. I.e. replace the -rtvpl
with -av
, and I would recommend adding -H
to add hardlink support.
Without the -go
implied by -a
you are not copying the group and user of the files, meaning all files and directories end up as being owned by root:root, which means that ordinary users can't access their files anymore.
참고 -v
자세한 자체로 매우 유용하지 않습니다, 나는이 추가 권장 -i
항목 화를 위해이 파일이 전송되는 이유를 변경합니다.
일정 기간 동안 동일한 트리에 복사하는 경우 --delete
삭제 된 파일이 백업을 채우는 것을 방지하는 데 유용 할 수 있습니다.
또한 전체 파일 시스템을 해당 소스 파일 시스템 내에 포함 된 디렉토리에 복사하므로 끝없이 반복적으로 복사하게됩니다. 해당 디렉토리를 제외하여이를 방지하십시오. 명령은 다음과 같이 끝납니다.
rsync -aHvi --exclude '/home/julian/Escritorio/copiaRsync/**' / /home/julian/Escritorio/copiaRsync/
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다