I know at least three ways to monitor a folder/file for changes and execute a shell script on change.

  • First, use "Folder Actions" of Automator

  • Second, the launchd.plist approach but it seems the folder been monitored couldn't go through recursively.

  • Third, use native FSEvents API on Mac OS X. like the modified fswatch utility

My question is that which one cost system resource (CPU or memory) less ?

  • 1
    It's probably safe to assume that the first two rely on the third -> all are rather efficient.
    – nohillside
    Jan 3, 2013 at 16:08
  • Folder actions are also limited to a single folder without subfolders. And they are only run when files are added, not when they are modified.
    – Lri
    Jan 3, 2013 at 18:31


You must log in to answer this question.

Browse other questions tagged .