2016-08-08 4 views
-1

rsync 또는 scp를 사용하여 매우 큰 파일을 전송합니다. 전송이 중단되어 모니터를 모니터링하고 수동으로 재개해야 할 때가 있습니다. 중단되었거나 완료되었지만 파일 (원본 및 대상)이 같은 크기가 아닌 파일 전송을 다시 시작하는 스크립트를 작성할 수 있습니까? (이 경우 전송은 처음부터 다시 시작됩니다. 먼저 제거됩니다. 대상 파일과 전송이 다시 시작됩니다. 언급 한 가지 내가 암호를 제공 할 필요가 원본 서버에 연결할 때, 그래서 암호 당신은 -P--partial 옵션을 필요로하는 스크립트중단 된 경우 파일 전송 다시 시작

답변

2

의 매개 변수 싶습니다 것입니다.

sudo rsync -azvvP /home/path/folder1/ /home/path/folder2 

당신은 여기에 몇 가지 추가 정보를 정기적으로 찾을 수 있습니다 :

  • Can rsync resume after being interrupted? 그래서 당신은 디렉토리 (동기화 연속 주) 동기화 할 경우

    --partial By default, rsync will delete any partially transferred file if the transfer 
         is interrupted. In some circumstances it is more desirable to keep partially 
         transferred files. Using the --partial option tells rsync to keep the partial 
         file which should make a subsequent transfer of the rest of the file much faster. 
    
        -P  The -P option is equivalent to --partial --progress. Its pur- 
         pose is to make it much easier to specify these two options for 
         a long transfer that may be interrupted. 
    

    : 남자 페이지에서

는 루프에서 실행, 자동으로 다시 시작하려면 :

RETRY_IN=5 
while rsync -azvvP /home/path/folder1/ /home/path/folder2 
do 
    echo "Retrying in ${RETRY_IN} sec" 
    sleep "${RETRY_IN}" 
done 
+0

확인을. RSYNC 또는 SCP가 자동으로 이력서 전송을 어떻게 할 수 있습니까? (전송이 사용자가 아닌) –

+0

@MichaelNathanSellers : 그냥 반복해서 시작하십시오. 내 업데이트보기 –

관련 문제