ãã¡ã¤ã«ã·ã¹ãã ã®å¤æ´ãåãåãããinotifywatch
kernel2.6.13ããå°å
¥ããããapiã§inotifyã¨ãããã®ãããã¾ããããã¯ããã¡ã¤ã«ã·ã¹ãã ã®ã¤ãã³ããç£è¦ããããã®ãã®ã§ãæå®ãããã£ã¬ã¯ããªé
ä¸ã«å¯¾ãã¦ã®æä½ãã¨ããã¨ãã§ãã¾ãã
ãã¨ãã°ã/tmp ãç£è¦ãã¦ããã¨ãããã/tmpé
ä¸ã¸ã®æä½ããã®apiã§ç£è¦ããããã¨ãã§ãã¾ãã
kernelã®apiã§ãããã³ãã³ãã©ã¤ã³ã§ä½¿ç¨ããããã«ã¯inotifywatchçã®ã³ãã³ããå¿
è¦ã«ãªãã®ã§ã¤ã³ã¹ãã¼ã«ããã¦ã¿ã¾ããdebianç³»ãªãaptã§ä¸çºã§å
¥ãã¾ãã
æ©é使ã£ã¦ã¿ã
inotifywatchã®ä½¿ãæ¹ã¯ç°¡åã§ããã³ãã³ãã®å¼æ°ã«å¯¾ãã¦ç£è¦å¯¾è±¡ã渡ãã ãã
ä»åã¯ãã£ã¬ã¯ããªåä½ã§ç£è¦ããããã¨æãã¾ãã®ã§ãå帰çã«åå¾ããã¦ã¿ããã¨æãã¾ãããã¹ãç¨ã«ãã¼ã ãã£ã¬ã¯ããªé
ä¸ã«fooã¨ãããã£ã¬ã¯ããªãä½æãã¦ããå®æ½ãã¾ãã
# mkdir ~/foo # inotifywatch -r ~/foo --ããã§å¥ã·ã§ã«ãç«ã¡ä¸ãã-- # touch ~/foo/bar --ããã§å ã»ã©ã®ã·ã§ã«ã«æ»ã-- CTRL+Cã§çµäº total attrib close_write open create filename 4 1 1 1 1 /home/wadap/foo/
ããã¨ãä¸è¨ã®è¦ã«ã¤ãã³ããåå¾ã§ãã¦ãããã¨ããããã¾ãã
ããã ãã ã¨ãã¾ã使ãéãç¡ãããã«ã¿ããããããã¾ããããinotifyãå©ç¨ãããã¡ã¤ã«åæã®ä»çµã¿ã§ããlsyncdã¨ãããã®ãã§ã¦ãã¦ããã®ã§ãããããã£ã¨ä½¿ããã¦ããã®ããããã¾ããã
ãã§ã«ãsmbdãudevã®ä¸èº«ã§ã¯ä½¿ããã¦ããããã§ããã