如何跟踪目录中当前正在增长的文件

gui*_*ido 3 linux filesystems find nfs

我有一个本地文件系统,它通过 nfs(非常大的 xfs 分区)导出为 rw。

某个地方(我无法确定谁或什么远程进程)正在写入、创建新文件或更新附加更多数据;并且可用磁盘空间很快就不足了。

为了确定哪些文件可以安全地移动到其他地方,我考虑了以下命令:

find . -type f -mtime +15 -size +100M
find . -type f -mmin -2 
Run Code Online (Sandbox Code Playgroud)

但是有没有一种通用方法可以调用 find 或任何其他系统实用程序来跟踪当前正在增长/正在写入(远程)的文件?

ter*_*don 5

最简单的方法可能是使用iotop它就像top但列出 I/O 操作。这应该会显示哪些进程/文件正在写入最多的数据。

\n\n
NAME\n       iotop - simple top-like I/O monitor\n\nDESCRIPTION\n       iotop  watches  I/O  usage  information output by the\n       Linux kernel (requires 2.6.20 or later) and  displays\n       a  table of current I/O usage by processes or threads\n       on the system. At least  the  CONFIG_TASK_DELAY_ACCT,\n       CONFIG_TASK_IO_ACCOUNTING,  CONFIG_TASKSTATS and CON\xe2\x80\x90\n       FIG_VM_EVENT_COUNTERS options need to be  enabled  in\n       your Linux kernel build configuration.\n
Run Code Online (Sandbox Code Playgroud)\n