Search code examples
linuxbashfilesystemsvirtual-machineinotify

How to monitor a directory for file changes without using inotifywait?


I require a VM for developing and my host is where my IDE is. I have discovered that inotifywait does not work with shared folders, as I am sharing a local folder with my Linux guest using Virtual Box.

Basically, I have a simple bash script which needs to watch a directory and wait for any file changes. Inotifywait would be the best option but I cannot get it to work with my shared folder.

I was wondering if there is another option for my problem?


Solution

  • Depending on the sizes of the files and the nature of the changes you could:

    • Create a checksum (md5, CRC, SHA256) of the files and watch for changes
    • check the size of the files and watch for changes