I've got an incrontab rule set up to react to a file being added to a particular directory on my ubuntu box, and run a script. This works fine, but my goal is to print the output of that script to a file.
I've tried a few different ways to go about it, and the only way I've been able to get it working so far is to take the generated command that incrontab creates, and run it myself. So my thinking is that its possible, I'm likely just missing something obvious to an experience linux user.
I've shortened some of the commands for brevity's sake. "watchdir" "scriptPath" and "arg1" are all paths. I am bringing in two arguments to the script, arg1, and the filename wildcard from the cron job.
I've tried: (These run the script, but don't output to file)
I've got an incrontab rule set up to react to a file being added to a particular directory on my ubuntu box, and run a script. This works fine, but my goal is to print the output of that script to a file.
I've tried a few different ways to go about it, and the only way I've been able to get it working so far is to take the generated command that incrontab creates, and run it myself. So my thinking is that its possible, I'm likely just missing something obvious to an experience linux user.
I've shortened some of the commands for brevity's sake. "watchdir" "scriptPath" and "arg1" are all paths. I am bringing in two arguments to the script, arg1, and the filename wildcard from the cron job.
I've tried: (These run the script, but don't output to file)
(These do nothing at all)
If I run 'tail /var/log/syslog' and grab the command generated from the incrontab below and paste it into the shell, it works fine
This works
Any insight as to what I could be missing?