Executing a bash script upon file creation

后端 未结 3 833
既然无缘
既然无缘 2020-12-08 17:57

I am looking write a small bash script to, when launched, watch a directory for any newly created files. If a new file appears, I want its presence to trigger a second scrip

3条回答
  •  一向
    一向 (楼主)
    2020-12-08 18:21

    Use iwatch. No, really. It'll handle all of the details of making a daemon, running on startup, monitor and log, so on and so on. All you need to do is set the options, and have your bash script handle the details of actually doing something with the file.

提交回复
热议问题