2011-11-13 3 views
0

xfce 창 관리자가있는 시스템 fedora 15가 있습니다.inotify --formfile 지시문

함께 놀 수있는 inotify 유틸리티가 설치되었습니다.

작업 프로세스 중에 내 파일이 어떻게되는지 제어하려고합니다. 내가 읽기 무시하는 폴더와 파일의 목록을 읽기 쉬운 명령

inotifywait --fromfile ~/list.inotify 

inotify를 실행하기 위해 오늘을 사용하는 명령이 있습니다. 내 목록 (list.inotify)

/home/alex 

@/home/alex/Torrnets/ 
@/home/alex/.pulse-cookie 

그래서 내 홈 폴더를 읽고 급류 폴더와 .pulse-쿠키 파일을 무시해야 있습니다.

Torrent도 무시합니다. 그러나 .pulse-cookie 파일은 무시하지 않습니다.

이 문제에 대한 해결책은 없습니까? (기반 패턴을 사용하는 솔루션을 게시하지 마십시오, 내가 절대 경로의와 파일 목록 작업 할 무시) 당신이 -e 인수를 지정하지 않으면 inotifywaitIN_ALL_EVENTSinotify_add_watch를 호출합니다

$man inotify 
    @<file> 
      When watching a directory tree recursively, exclude the specified file from being watched. The file must be specified with a relative or absolute path according to whether a relative or absolute path is given for watched directories. If a specific 
      path is explicitly both included and excluded, it will always be watched. 

      Note: If you need to watch a directory or file whose name starts with @, give the absolute path. 

    --fromfile <file> 
      Read filenames to watch or exclude from a file, one filename per line. If filenames begin with @ they are excluded as described above. If <file> is `-', filenames are read from standard input. Use this option if you need to watch too many files to 
      pass in as command line arguments. 

답변

2

, - 어떤 지켜 디렉토리 내 파일에 대해 발생하는 이벤트가 발생 inotify(7) 말한다 참고 :

디렉토리를 모니터링 할 때, 이벤트는 별표 (*) 위의 디렉토리에있는 파일 발생할 수 있습니다 표시된 경우 을에 반환 된 inotify_event 구조체의 name 필드는 t를 식별합니다. 그는 디렉토리 내의 파일 이름입니다.

inotifywait code in question을 보면 디렉토리 만 제외하고 디렉토리를 확인합니다. 디렉토리 나 사용되지 않은 제외 항목을 지정할 때 경고를 받았다면 사용자에게 좀 더 친숙하게 느껴지 겠지만 현재 그대로 사용하고 있습니다.

+0

죄송합니다. 원래 게시물에 수동 인용이 업데이트되어 있습니다. – RusAlex