<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: tail on deleted/re-recreated file in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/tail-on-deleted-re-recreated-file/m-p/3075736#M141576</link>
    <description>As names don't mean too much to unix, I don't think you are going to succeed here.  When you do a "tail -f" on a file and the file is deleted, the file doesn't really go away until you stop doing your "tail".  Therefore, if you create a new file, even with the same name, it will be a different file.The only way this is going to work is if you script tail to set an alarm every now and then to stop "tailing" and start again.</description>
    <pubDate>Mon, 22 Sep 2003 02:08:16 GMT</pubDate>
    <dc:creator>Mark Grant</dc:creator>
    <dc:date>2003-09-22T02:08:16Z</dc:date>
    <item>
      <title>tail on deleted/re-recreated file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/tail-on-deleted-re-recreated-file/m-p/3075735#M141575</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;First, my OS's are HP-UX 10.20 &amp;amp; 11.0&lt;BR /&gt;When I use "tail" command to monitor a log file, if that file is deleted and recreated with the same name ( while tail is running ), then "tail" still runs but never show new lines added to the file. As far as I know, that is the normal behaviour.&lt;BR /&gt;Anybody knows if exists some sort of utility/command that can "monitor" a file even if it's deleted and recreated with the same name?&lt;BR /&gt;&lt;BR /&gt;Thanks in advance.&lt;BR /&gt;Kind regards,&lt;BR /&gt;Zigor</description>
      <pubDate>Mon, 22 Sep 2003 01:40:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/tail-on-deleted-re-recreated-file/m-p/3075735#M141575</guid>
      <dc:creator>Zigor Buruaga</dc:creator>
      <dc:date>2003-09-22T01:40:47Z</dc:date>
    </item>
    <item>
      <title>Re: tail on deleted/re-recreated file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/tail-on-deleted-re-recreated-file/m-p/3075736#M141576</link>
      <description>As names don't mean too much to unix, I don't think you are going to succeed here.  When you do a "tail -f" on a file and the file is deleted, the file doesn't really go away until you stop doing your "tail".  Therefore, if you create a new file, even with the same name, it will be a different file.The only way this is going to work is if you script tail to set an alarm every now and then to stop "tailing" and start again.</description>
      <pubDate>Mon, 22 Sep 2003 02:08:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/tail-on-deleted-re-recreated-file/m-p/3075736#M141576</guid>
      <dc:creator>Mark Grant</dc:creator>
      <dc:date>2003-09-22T02:08:16Z</dc:date>
    </item>
    <item>
      <title>Re: tail on deleted/re-recreated file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/tail-on-deleted-re-recreated-file/m-p/3075737#M141577</link>
      <description>Hi Zigor,&lt;BR /&gt;&lt;BR /&gt;As explained a file is not a file, but an inode. If you want to empty the file to be able to start all over, it's better to null it then to remove and re-create it. Else there is no "tail" solution possible. Of course Perl or other scripts can be written to work around it.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;/path/to/my/file&lt;BR /&gt;&lt;BR /&gt;is an easy way to null a file, the inode remains then so that also tail -f will start working.&lt;BR /&gt;&lt;BR /&gt;Regs David&lt;BR /&gt;&lt;BR /&gt;B.T.W. "cp" will create a new inode where a "mv" on the same FS will keep the inode.</description>
      <pubDate>Mon, 22 Sep 2003 02:53:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/tail-on-deleted-re-recreated-file/m-p/3075737#M141577</guid>
      <dc:creator>David_246</dc:creator>
      <dc:date>2003-09-22T02:53:58Z</dc:date>
    </item>
    <item>
      <title>Re: tail on deleted/re-recreated file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/tail-on-deleted-re-recreated-file/m-p/3075738#M141578</link>
      <description>&lt;BR /&gt;Hi Zigor,&lt;BR /&gt;&lt;BR /&gt;I have just tried a workaround, which unfortunately did not work! First, I had a continous tail running on a log file, e.g.:&lt;BR /&gt;# tail -fn1 your_log_file&lt;BR /&gt;I then appended to that file, e.g.:&lt;BR /&gt;# echo "helli" &amp;gt;&amp;gt; your_log_file&lt;BR /&gt;# echo "hello" &amp;gt;&amp;gt; your_log_file&lt;BR /&gt;to which the continous tail reacted.&lt;BR /&gt;I then tried to set the file pointer of your_log_file into zero position:&lt;BR /&gt;# cat /dev/null &amp;gt; your_log_file&lt;BR /&gt;which truncates the file to zero bytes. Unfortunately the tail command is not aware of this; it still looks at the position it was on before the /dev/null action. Therefore, it is not until you write past the position before the "dev/null" action that  the tail command reacts again.&lt;BR /&gt; I cannot see how to overcome this, except by creating the log file as a fifo, e.g.:&lt;BR /&gt;# mkfifo your_log_file&lt;BR /&gt;# tail -1fn your_log_file&lt;BR /&gt;# echo "halli hallo" &amp;gt; your_log_file&lt;BR /&gt;&lt;BR /&gt;which of course is not what you want, as it raises a number of other problems, but I am looking forward to the coming suggestions!&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;regards,&lt;BR /&gt;John K.</description>
      <pubDate>Mon, 22 Sep 2003 03:17:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/tail-on-deleted-re-recreated-file/m-p/3075738#M141578</guid>
      <dc:creator>john korterman</dc:creator>
      <dc:date>2003-09-22T03:17:42Z</dc:date>
    </item>
    <item>
      <title>Re: tail on deleted/re-recreated file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/tail-on-deleted-re-recreated-file/m-p/3075739#M141579</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Thanks for the replies.&lt;BR /&gt;Forgot to mention that I have not control over the log files, so I can not create, copy or move them.&lt;BR /&gt;I think I need some kind of new "tail" binary, that can do some kind of monitoring over the original inode and reopen the original file name in case it has been re-created ... or something like that ;-)&lt;BR /&gt;&lt;BR /&gt;Thanks again for all your replies.&lt;BR /&gt;Kind regards,&lt;BR /&gt;Zigor&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 22 Sep 2003 03:47:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/tail-on-deleted-re-recreated-file/m-p/3075739#M141579</guid>
      <dc:creator>Zigor Buruaga</dc:creator>
      <dc:date>2003-09-22T03:47:09Z</dc:date>
    </item>
    <item>
      <title>Re: tail on deleted/re-recreated file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/tail-on-deleted-re-recreated-file/m-p/3075740#M141580</link>
      <description>Zigor,You will not be able to do that either.When you the log file gets re-created, it will have a new inode even if it has the same name.  There is no way around this.As far as I can see, your only possibility is to "tail -f" and then interupt it and start again.  You might miss some lines though.  You can interupt it if you use a script which starts a sleep process in the background which also send the main script a signal say SIGUSR1 when the sleep has finished.  The main script traps this signal and starts the tail again.</description>
      <pubDate>Mon, 22 Sep 2003 04:04:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/tail-on-deleted-re-recreated-file/m-p/3075740#M141580</guid>
      <dc:creator>Mark Grant</dc:creator>
      <dc:date>2003-09-22T04:04:54Z</dc:date>
    </item>
    <item>
      <title>Re: tail on deleted/re-recreated file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/tail-on-deleted-re-recreated-file/m-p/3075741#M141581</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Now it's clear, I'm looking for something impossible, ... or not developed yet ( it could be a good and very useful improvement ).&lt;BR /&gt;Anyway, thanks to all.&lt;BR /&gt;&lt;BR /&gt;Kind regards,&lt;BR /&gt;Zigor</description>
      <pubDate>Mon, 22 Sep 2003 04:56:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/tail-on-deleted-re-recreated-file/m-p/3075741#M141581</guid>
      <dc:creator>Zigor Buruaga</dc:creator>
      <dc:date>2003-09-22T04:56:53Z</dc:date>
    </item>
    <item>
      <title>Re: tail on deleted/re-recreated file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/tail-on-deleted-re-recreated-file/m-p/3075742#M141582</link>
      <description>Although this entry is old, this reply mnay still be of some use.  I had the same problem and used Google.&lt;BR /&gt;&lt;BR /&gt;There is a module for Python call TailFollow which addresses this exact problem.  Unfortunately HPUX ships with Python 1.something; TailFollow expects 2.0 or later.  I was able to downgrade the core component of TailFollow to 1.something capabilities.</description>
      <pubDate>Mon, 05 Jan 2004 11:56:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/tail-on-deleted-re-recreated-file/m-p/3075742#M141582</guid>
      <dc:creator>Martin Robinson_4</dc:creator>
      <dc:date>2004-01-05T11:56:07Z</dc:date>
    </item>
    <item>
      <title>Re: tail on deleted/re-recreated file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/tail-on-deleted-re-recreated-file/m-p/3075743#M141583</link>
      <description>Zigor --&lt;BR /&gt;&lt;BR /&gt;Another option would be to periodically (once a minute or whatever), make a copy of the log file and diff it to your previous copy and then have your script react that diff instead.&lt;BR /&gt;&lt;BR /&gt;Best regards,&lt;BR /&gt;&lt;BR /&gt;Kent M. Ostby&lt;BR /&gt;</description>
      <pubDate>Mon, 05 Jan 2004 12:03:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/tail-on-deleted-re-recreated-file/m-p/3075743#M141583</guid>
      <dc:creator>Kent Ostby</dc:creator>
      <dc:date>2004-01-05T12:03:27Z</dc:date>
    </item>
  </channel>
</rss>

