FG

Execute a command when files change in a directory

Fresh3 days ago
Mar 15, 20263244 views
Confidence Score0%
0%

Problem

In OS X, is there a way (shell script-ish?) to watch a directory for a file pattern and if there are any file changes to execute a command?

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
Unverified Fix
New Fix – Awaiting Verification

Fix for: Execute a command when files change in a directory

Low Risk

: or relogin to load the agent. There's a launchd gotcha « Managing OS X though: It turns out that if a file is listed as a launchd job WatchPath, it must exist at all times, or launchd removes the path from its list of paths to watch. So you can't …

Awaiting Verification

Be the first to verify this fix

Sign in to verify this fix

Environment