Watchman: Execute a command when something changes
81–90 of 98 posts
Re: Watchman: Execute a command when something changes
#82Re: Watchman: Execute a command when something changes
#83I've been using fswatch to great effect. The big advantage is that it's truly cross-platform, falling back to polling if no fs notification system is available as long as stat(2) works. Very composable as you just pipe its output to whatever you want (typically a while read do end), so exclusion is a awk/sed/perl/grep/rg away, and command can be as simple or complex as it needs to while the tool itself stays lean. Co…
> If you are installing fswatch using a package manager and you would like the PDF manual to be bundled into the package, please send a feature request to the package maintainer. I can't find the PDF manual in the repo. Do I need to contact the author and say please?
Re: Watchman: Execute a command when something changes
#84Not to be confused with Facebook’s file watch daemon, also names watchman, which does the same sort of thing but is more complicated. There’s a bunch of tools that integrate Facebook’s watchman for more efficient change tracking. Advantages of Facebook’s watchman: 1. Implements efficient file system event watches on macOS and Windows 2. IPC/daemon system reduces resource use because overlapping watches/triggers don’t…
Re: Watchman: Execute a command when something changes
#85Does anybody have a good "execute a command when nothing changes" tool? I have some situations where I'd like to take action if, say, a file hasn't had its mtime updated in 24 hours.
Not sure if there's a way to do it instantly, but one way is to just run a find command in a cron job every X hours: find /foo/bar -type f -mtime +1 | xargs foobar
-exec foobar {} +
Re: Watchman: Execute a command when something changes
#86I also found this Cygwin mailing list post by Erik Blake: https://cygwin.com/pipermail/cygwin/2018-May/237069.html
And patches to make Cygwin support inotify_init() and friends implemented on top of the Windows native API are certainly welcome.
I think I just found my next personal project...Re: Watchman: Execute a command when something changes
#87Re: Watchman: Execute a command when something changes
#88Not to be confused with Facebook’s file watch daemon, also names watchman, which does the same sort of thing but is more complicated. There’s a bunch of tools that integrate Facebook’s watchman for more efficient change tracking. Advantages of Facebook’s watchman: 1. Implements efficient file system event watches on macOS and Windows 2. IPC/daemon system reduces resource use because overlapping watches/triggers don’t…
Re: Watchman: Execute a command when something changes
#89Not to be confused with Facebook’s file watch daemon, also names watchman, which does the same sort of thing but is more complicated. There’s a bunch of tools that integrate Facebook’s watchman for more efficient change tracking. Advantages of Facebook’s watchman: 1. Implements efficient file system event watches on macOS and Windows 2. IPC/daemon system reduces resource use because overlapping watches/triggers don’t…
If you sign up for notifications on both github projects, you can watch the watchmen.
Re: Watchman: Execute a command when something changes
#90Can't this functionality be duplicated with a while loop and du?
while $(du -s file.log)