Chinaunix

标题: Solaris之中的tail的问题 [打印本页]

作者: duanwenwen_850    时间: 2008-10-21 13:26
标题: Solaris之中的tail的问题
tail -f  test.log >> test1.log  
当test.log被删除,此命令就终止了,请问如果,重建test.log的时候tail 这条命令能自动继续。

linux系统上可以用F参数。请问solaris有什么好的办法么
作者: duanwenwen_850    时间: 2008-10-21 13:58
--follow  (-f), tail defaults to following the file descriptor, which means that even if a tail'ed file is renamed, tail will
       continue to track its end.  This default behavior is not desirable when you really want to track the actual name of the  file,  not
       the  file  descriptor (e.g., log rotation).  Use --follow=name in that case.  That causes tail to track the named file by reopening
       it periodically to see if it has been removed and recreated by some other program.



类似于linux上的这个参数
作者: ga0feng    时间: 2008-10-21 14:20
-f参数跟linux里面的-F不一样。
貌似这个任务solaris里的tail干不了
作者: duanwenwen_850    时间: 2008-10-21 20:56
只好用别的途径了




欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2