如何通过网络拖尾文件?

Ble*_*ers 5 mount tail

我怎样才能tail -f通过网络创建一个文件,比如在\\192.168.2.130\public\print.log

我尝试了以下变体:

  • tail -f //192.168.2.130/Southpaw/Tactic/print.log 哪个错误的说法 tail: cannot open `//192.168.2.130/Southpaw/Tactic/print.log' for reading: No such file or directory
  • 使用 挂载路径mount -t cifs,然后尝试,tail -f但这也不起作用,这意味着它不会输出对文件所做的更新。

cha*_*aos 8

继续尝试安装 cif。只需使用带有以下参数的tail:

tail --retry --follow=name yourfile
Run Code Online (Sandbox Code Playgroud)

像这样,tail 跟随文件名而不是描述符,并且--retry即使文件在一段时间内无法访问,它也会再次尝试。


jof*_*fel 3

这似乎是cifs内核模块中的一个错误。它可能是在比您使用的内核版本更新的内核版本中修复的。尝试使用directiomount 参数来规避该错误(这可能会严重降低文件系统的性能)。

使用watch tail print.log也可能是一个解决方案。它每 2 秒显示一次文件的最后 10 行。