File Monitoring Daemon on Unix

耗尽温柔 提交于 2019-12-06 14:48:37

问题


I am looking to write a file monitoring daemon that runs on Fedora 8 that monitors a file and reports back when the file was last modified in minutes.

What would be the best way to do this, Im a bit of a newbie in terms of writing daemons like this?

I guess I write a script? and then run this using a daemon. If anyone has any links to point me in the right direction it would be helpful :)


回答1:


My choice would be to use the cron job manager. So you write a program in the language of your choice that monitors that file and reports whatever you need. Then program your cron to execute that program as often as you whant (daily, weekle, every minute...).

Cron is easy to use, here, a tutorial. :)




回答2:


Take a look at iwatch It allows you to fire off jobs only when things change, you don't have to continuously check them with cron.




回答3:


You can use inotify tools for that. And get a more recent Fedora version, 8 is few years old.



来源:https://stackoverflow.com/questions/5311274/file-monitoring-daemon-on-unix

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!