<?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: Need to Monitor File Writes in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/need-to-monitor-file-writes/m-p/4062707#M306147</link>
    <description>Hi Steve:&lt;BR /&gt;&lt;BR /&gt;Look at the manpages for 'touch' and 'sh-posix'.&lt;BR /&gt;&lt;BR /&gt;One way is to create a reference point (file) with 'touch -r' that captures your file's last modification timestamp. Then compare what you last saw with the current value using something like 'myfile -nt reffile'.  If the you file has been updated, then your application is running.&lt;BR /&gt;&lt;BR /&gt;Your script can loop, sleeping for 30-seconds; wake-up; compare the file timestamps; update the reference file timestamp to be that of your monitored log if they differ; and return to sleep.&lt;BR /&gt;&lt;BR /&gt;If n-number of loops find that the log timestamp has not changed, email yourself an alert.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Wed, 29 Aug 2007 18:09:23 GMT</pubDate>
    <dc:creator>James R. Ferguson</dc:creator>
    <dc:date>2007-08-29T18:09:23Z</dc:date>
    <item>
      <title>Need to Monitor File Writes</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/need-to-monitor-file-writes/m-p/4062706#M306146</link>
      <description>We have an application that writes to a logfile in the /tmp directory.  If the application stops functioning, this logfile no longer is written to.&lt;BR /&gt;&lt;BR /&gt;Any suggestions as to how I can monitor this logfile?  'Are You Functioning' writes occur approximately 15 seconds from within the application.  Over a 7 day period, the file will grow in size to approximately 200MB.&lt;BR /&gt;&lt;BR /&gt;TIA.&lt;BR /&gt;&lt;BR /&gt;Steve Lowe&lt;BR /&gt;Aurora University</description>
      <pubDate>Wed, 29 Aug 2007 17:52:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/need-to-monitor-file-writes/m-p/4062706#M306146</guid>
      <dc:creator>Steve Lowe (IL)</dc:creator>
      <dc:date>2007-08-29T17:52:14Z</dc:date>
    </item>
    <item>
      <title>Re: Need to Monitor File Writes</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/need-to-monitor-file-writes/m-p/4062707#M306147</link>
      <description>Hi Steve:&lt;BR /&gt;&lt;BR /&gt;Look at the manpages for 'touch' and 'sh-posix'.&lt;BR /&gt;&lt;BR /&gt;One way is to create a reference point (file) with 'touch -r' that captures your file's last modification timestamp. Then compare what you last saw with the current value using something like 'myfile -nt reffile'.  If the you file has been updated, then your application is running.&lt;BR /&gt;&lt;BR /&gt;Your script can loop, sleeping for 30-seconds; wake-up; compare the file timestamps; update the reference file timestamp to be that of your monitored log if they differ; and return to sleep.&lt;BR /&gt;&lt;BR /&gt;If n-number of loops find that the log timestamp has not changed, email yourself an alert.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 29 Aug 2007 18:09:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/need-to-monitor-file-writes/m-p/4062707#M306147</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2007-08-29T18:09:23Z</dc:date>
    </item>
    <item>
      <title>Re: Need to Monitor File Writes</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/need-to-monitor-file-writes/m-p/4062708#M306148</link>
      <description>You could do an ls -l filename every few minutes and compare the size to the last size. If that is constant then the log has stpped growing:&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;&lt;BR /&gt;FILENAME=/aaa/bbb/myfile&lt;BR /&gt;typeset -i LAST_SIZE=-1&lt;BR /&gt;typeset DELAY=300 # 5 minutes&lt;BR /&gt;typeset -i SIZE=0&lt;BR /&gt;&lt;BR /&gt;LAST_SIZE=$(ls -l ${FILENAME} | awk '{print $5}')&lt;BR /&gt;while [[ 1 -eq 1 ]] # loop forever&lt;BR /&gt;  do&lt;BR /&gt;    sleep ${DELAY}&lt;BR /&gt;    SIZE=$(ls -l ${FILENAME} | awk '{print $5}')&lt;BR /&gt;    if [[ ${SIZE} -eq ${LAST_SIZE} ]]&lt;BR /&gt;      then&lt;BR /&gt;        echo "File ${FILENAME} ain't growing." &amp;gt;&amp;amp;2 &lt;BR /&gt;      fi&lt;BR /&gt;     LAST_SIZE=${SIZE}&lt;BR /&gt;  done&lt;BR /&gt;&lt;BR /&gt;A little checking needs to be done such as does the file exist? but this should get you started.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 29 Aug 2007 18:13:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/need-to-monitor-file-writes/m-p/4062708#M306148</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2007-08-29T18:13:00Z</dc:date>
    </item>
  </channel>
</rss>

