[英]Detect directory changes in unix
How could I track changes of specific directory in UNIX?如何跟踪 UNIX 中特定目录的更改? For example, I launch some utility which create some files during its execution.
例如,我启动了一些在执行过程中创建一些文件的实用程序。 I want to know what exact files were created during one particular launch.
我想知道在一次特定发布期间创建了哪些确切文件。 Is there any simple way to get such information?
有没有简单的方法来获取这些信息? Problem is that:
问题在于:
Please notice that I do not want to know whether directory has been changed as stated here , I need filenames which ideally could be grepped to match specific pattern.请注意,我不想知道目录是否已按照此处所述进行更改,我需要理想情况下可以匹配特定模式的文件名。
您需要订阅文件系统更改通知。
您应该使用诸如 FAM、gamin 或 inotify 之类的东西来检测文件何时被创建、关闭等。
您可以使用strace -f myscript
跟踪脚本进行的所有系统调用,并使用grep
过滤创建新文件的系统调用。
您可以使用script
命令来跟踪启动的命令。
You could use the Linux Auditing System.您可以使用 Linux 审计系统。 Here is a howto link:
这是一个操作方法链接:
http://www.cyberciti.biz/tips/linux-audit-files-to-see-who-made-changes-to-a-file.html http://www.cyberciti.biz/tips/linux-audit-files-to-see-who-made-changes-to-a-file.html
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.