2014-03-13 2 views
4

나는 정말 어리석은 사람이다. 나는 어리석게도 간단한 질문에 대한 답을 찾기 위해 거의 두 시간을 보냈다. 어떻게 필자의 Mac에서 두 개의 로컬 파일을 지속적으로 동기화 할 수 있습니까? rsync과 관련된 다양한 트릭을 조사한 다음 lsyncd을 사용하여 해결했습니다.하나의 파일 만 lsyncd와 동기화 할 수 있습니까?

그러나 내 인생에서 어떻게 lsyncd 두 개의 특정 파일을 동기화 할 수 있는지 알 수 없습니다. 이것은 API에서도 지원됩니까? 문서에서이 방식으로 rsync을 사용할 수 있는지 여부는 명확하지 않습니다. 나는 이것을 막고있는 CLI 옵션을 lsyncd이 전달하고 있다고 가정합니다. 구성은 다음과 같습니다.

sync = { 
    default.rsync, 
    source = "/Users/username/Downloads/test1.txt", 
    target = "/Users/username/Downloads/test2.txt", 
    rsync = { 
     binary = "/usr/local/bin/rsync", 
     archive = "true" 
    } 
} 

'동기화 할 항목이 없습니다.'라는 메시지 만 표시됩니다. 도움?

답변

0

lsynd에서 당신은 내가 옆에있는 시작 lsyncd 후이

settings { 
    logfile = "/var/log/lsyncd.log", 
    statusFile = "/var/log/lsyncd-status.log", 
    statusInterval = 20, 
    nodaemon = true 
} 
sync { 
    default.rsync, 
    source="/srcdir/", 
    target="/dstdir/", 
    rsync = { 
    archive = true, 
    compress = true, 
    whole_file = false, 
    _extra = { "--include=asterisk", "--exclude=*" }, 
    verbose = true 
    }, 
    delay=5, 
    log=all, 
} 

처럼 할 수

[email protected]:/srcdir# ls 
12 aster asterisk 

[email protected]:/dstdir# ls 
asterisk 
관련 문제