cross-posted from: https://lemmy.ml/post/35169329
Using a shell script, can I watch a folder and block program execution until a file in a certain folder changes?
Run a shell script whenever a file in a certain directory changes?
a year ago by ghosttownenjoyer👻🌃 to c/shell
cross-posted from: https://lemmy.ml/post/35169329
Using a shell script, can I watch a folder and block program execution until a file in a certain folder changes?
Thanks for your hint! After some experimentation and man page reading, this was what I was interested in:
inotifywait --event modify,create ./targetfolder/; echo "new change, that I am interested in, occurred in targetfolder";
I was interested in both file modification and file creation events.
@programming.dev
Keep posts about shell scripting! Here are some guidelines to help:
In general, if your submission text is primarily shell code, then it is welcome here!
go to feed...
@programming.dev
Keep posts about shell scripting! Here are some guidelines to help:
In general, if your submission text is primarily shell code, then it is welcome here!
go to feed...
inotifywait /path/to/fileExample:
Then in another terminal do something like
touch test.filesave