2011-11-13 9 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-クッキーファイルを無視すべきではあります。

トレントも無視されます。しかし、.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

関連する問題