With
incrontab
, I want to monitor a file and whenever it gets modified, I want to replace a string in it. But that will create an infinite loop, I guess. When I configure it with the following table:
/etc/file.md IN_MODIFY sed -i 's/Hello/Hi/g' $@
It works once, but never again. I don't see any error messages and the status of incrond
remains fine, but I think the service is stuck in an infinite loop. If I restart it, it will work again one single time.
Is there a way to prevent such an infinite loop? Or is there another approach to my problem?
Asked by stackprotector
(870 rep)
Jul 14, 2022, 08:28 AM
Last activity: Jul 14, 2022, 11:45 AM
Last activity: Jul 14, 2022, 11:45 AM