You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In some application (mine right now), it may be useful to have fswatch generate an event (empty line, heartbeat or else) every X seconds even if there is no activity on the monitored files
-T (Timeout) or -A (Artificial) ?
Thanks.
The text was updated successfully, but these errors were encountered:
The heartbeat event can be possibly achieved using pgrep or ps because fswatch should be running if it operates and if there is an error, it exits and you would not find a process running.
For example:
while pgrep fswatch >/dev/null
do
echo "fswatch heartbeat"
sleep 1
done
timeout option would be very useful, but if you are looking for ways to emulate it in bash, you can look at script I wrote https://gist.github.com/JLarky/8a4033688d516ac9a5d6 basically idea is that I have separate process timeout that touches file TIMEOUT_TMP_FILE after some time and I have fswatch to watch for both desired directory and this TIMEOUT_TMP_FILE.
Keep in mind, that in my script I don't reset timeout after I get output from fswatch, if you need that you would have to add this functionality by yourselves.
I'm thinking about adding this feature to the pipeline shortly. To keep things simple, I'm thinking about having fswatch generate the heartbeat always, even if change events were detected between two consecutive heart beats. Any feedback on this?
In some application (mine right now), it may be useful to have fswatch generate an event (empty line, heartbeat or else) every X seconds even if there is no activity on the monitored files
-T (Timeout) or -A (Artificial) ?
Thanks.
The text was updated successfully, but these errors were encountered: