Questions tagged [fswatch]

A cross-platform file change monitor with multiple backends: Apple OS X File System Events API, *BSD kqueue, Linux inotify and a stat-based backend.

A cross-platform file change monitor with multiple backends: Apple OS X File System Events API, *BSD kqueue, Linux inotify and a stat-based backend.

http://emcrisostomo.github.io/fswatch/

54 questions
0
votes
1 answer

Sending response after file changes

I want to execute a commande in matlab using shelljs and after it finish send response to client : var cmd = 'matlab -nojvm -nosplash -nodesktop -noFigureWindows -minimize -r \" senario(); exit; \"'; shell.exec(cmd, function (code, stdout,…
ketimaBU
  • 901
  • 4
  • 15
  • 35
0
votes
1 answer

How to insert variable in fswatch regex?

I'm trying to use a variable to identify mxf or mov file extensions. The following works where I explicitly name the file extensions with a regular expression. ${FSWATCH_PATH} -0 \ -e ".*" --include ".*\.[ mxf|mov ]" \ --event Updated --event…
0
votes
1 answer

Is there a reliable directory watcher that can be used to run shell commands on any modification?

I am looking for a tool (preferably X platform) that can watch a directory's entire tree and run shell commands when it happens. I have tried many tools prior, such as fswatch, chokidar, findr... But they have quirk issues, e.g. some of these…
user2167582
  • 5,986
  • 13
  • 64
  • 121
0
votes
2 answers

Pipe fswatch output into a shell script

I am trying to pipe the output of fswatch to several commands in a shell script with following technique: $ fswatch -0 [opts] [paths] | xargs -0 -n 1 -I {} [command] Instead of [command] I put the shell script path. Here is my command line: fswatch…
saltarob
  • 1
  • 3
0
votes
1 answer

Fswatch with different extensions

I need to watch files with different extensions, and run an .sh command after every change. With fswatch, I've been able to watch each extension separately, like: fswatch *.html | (while read; do ./dev.sh; done) fswatch index-static/*.js | (while…
maxijb
  • 541
  • 4
  • 13
0
votes
1 answer

Directory monitoring using fswatch

I am using fswatch to monitor a directory and run a script when video files are copied into that directory: fswatch -o /Path/To/Directory/Directory | xargs -n 1 sh /Path/To/Script/Script.sh The problem is that the file is often not completed its…
ssmc
  • 21
  • 6
0
votes
2 answers

Node Restart in Shell Script

I want to rerun the node server, whenever there's changes in file, but i want to use fswatch. i am using fswatch with the shell script like nohup node server.js & but i can't run the same script again since it will throw EADDRINUSE. whats the best…
Dineshkumar
  • 4,165
  • 5
  • 29
  • 43
0
votes
1 answer

monitor a file on mac os x

There are a lot of similar posts out there, but none that does exactly what I want: I want a simple script, that watches a folder on a Mac for changes and passes the filename of the modified file to command/script when changes are detected. The tool…
John Smith
  • 1,059
  • 1
  • 13
  • 35
0
votes
1 answer

PLIST seems correct, but execution shows no Results

I wrote an agent to monitor critical system files: ag1-launchagents #!/bin/bash arg1=/System/Library/LaunchAgents fswatch $arg1 "growlnotify -n "FSWatch" -m "FSWATCH:Changed:$arg1" -s" I created the same file for 6 other directories to monitor…
1 2 3
4