Trying to make find and replace in a file when it is modified by the system or other user. Incron+SED is the combination has worked the best till this moment. Problem is when the command is put into incrontab, sed command does not work. Command works when ran from a console. Tested that trivial /bin/cp command works correcly from incron.
SED command:
/bin/sed 's+APPLES+ORANGES+g' /bseller/salidzini.xml > /bseller/salidzini_new.xml
INCRONTAB content: /bseller/salidzini.xml IN_CLOSE_WRITE /bin/sed 's+APPLES+ORANGES+g' /bseller/salidzini.xml > /bseller/salidzini_new.xml
Checked out the syslog - event is triggered and the command runs, however the salidzini_new.xml file is not being generated. sed provides no errors in syslog.
Maybe there are some characters need to be escaped? Hope that someone has some hints.
0 Answers