<?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: comparing file date to system date in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/comparing-file-date-to-system-date/m-p/4951035#M790786</link>
    <description>Thanks John.  I was able to modify your response to get exactly what I needed.</description>
    <pubDate>Mon, 16 Jan 2006 14:47:34 GMT</pubDate>
    <dc:creator>Staci Tribelhorn</dc:creator>
    <dc:date>2006-01-16T14:47:34Z</dc:date>
    <item>
      <title>comparing file date to system date</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/comparing-file-date-to-system-date/m-p/4951030#M790781</link>
      <description>I have a file which I would like to test nightly to make sure it's been updated prior to running an upload process.  Can you tell me how I can read the file modified date and then compare it to the system date?  My goal is create a script that will e-mail me when the file hasn't been updated for that day. Time of the modification doesn't matter, I just need to compare the dates. &lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Staci</description>
      <pubDate>Mon, 09 Jan 2006 18:49:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/comparing-file-date-to-system-date/m-p/4951030#M790781</guid>
      <dc:creator>Staci Tribelhorn</dc:creator>
      <dc:date>2006-01-09T18:49:22Z</dc:date>
    </item>
    <item>
      <title>Re: comparing file date to system date</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/comparing-file-date-to-system-date/m-p/4951031#M790782</link>
      <description>Hi Staci:&lt;BR /&gt;&lt;BR /&gt;One approach is as follows:&lt;BR /&gt;&lt;BR /&gt;# touch -amt `date +%m%d`0000 /tmp/myref&lt;BR /&gt;# [ yourfile -nt /tmp/myref ] || mailx -s "yourfile not updated!" root &amp;lt; /dev/null&lt;BR /&gt;&lt;BR /&gt;This creates a reference file whose modification timestamp is today at 00:00 hours.  If 'yourfile' is *not* newer than that reference time, an email is generated to 'root' informing you of the condition.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Mon, 09 Jan 2006 19:43:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/comparing-file-date-to-system-date/m-p/4951031#M790782</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2006-01-09T19:43:24Z</dc:date>
    </item>
    <item>
      <title>Re: comparing file date to system date</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/comparing-file-date-to-system-date/m-p/4951032#M790783</link>
      <description>I suppose you may get some better answers, but here is a quick one, -&lt;BR /&gt;&lt;BR /&gt;if [[ `ll ${FILENAME} |awk '{ print$6,$7 }'` = `date +%b%e` ]]&lt;BR /&gt;then&lt;BR /&gt;  # the dates match...&lt;BR /&gt;else&lt;BR /&gt;  # the dates don't match, send email...&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;( not sure how well this will work in all different circomstances)&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt; - John</description>
      <pubDate>Mon, 09 Jan 2006 19:48:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/comparing-file-date-to-system-date/m-p/4951032#M790783</guid>
      <dc:creator>John Kittel</dc:creator>
      <dc:date>2006-01-09T19:48:50Z</dc:date>
    </item>
    <item>
      <title>Re: comparing file date to system date</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/comparing-file-date-to-system-date/m-p/4951033#M790784</link>
      <description>I suppose you may get some better answers, but here is a quick one, -&lt;BR /&gt;&lt;BR /&gt;if [[ `ll ${FILENAME} |awk '{ print$6,$7 }'` = `date +%b%e` ]]&lt;BR /&gt;then&lt;BR /&gt;  # the dates match...&lt;BR /&gt;else&lt;BR /&gt;  # the dates don't match, send email...&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;( not sure how well this will work in all different circumstances)&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt; - John</description>
      <pubDate>Mon, 09 Jan 2006 19:50:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/comparing-file-date-to-system-date/m-p/4951033#M790784</guid>
      <dc:creator>John Kittel</dc:creator>
      <dc:date>2006-01-09T19:50:09Z</dc:date>
    </item>
    <item>
      <title>Re: comparing file date to system date</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/comparing-file-date-to-system-date/m-p/4951034#M790785</link>
      <description>You can try as,&lt;BR /&gt;&lt;BR /&gt;#!/bin/ksh&lt;BR /&gt;file=/etc/testfile&lt;BR /&gt;&lt;BR /&gt;if [[ "$(ls -l $file | awk '{ print $7,$8 }')" = "$(date +'%d %H:%M')" ]]&lt;BR /&gt;then&lt;BR /&gt;  echo "File is updated" | mail mailid&lt;BR /&gt;else&lt;BR /&gt;  echo "File is not updated" | mail mailid&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;--&lt;BR /&gt;Muthu</description>
      <pubDate>Mon, 09 Jan 2006 22:26:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/comparing-file-date-to-system-date/m-p/4951034#M790785</guid>
      <dc:creator>Muthukumar_5</dc:creator>
      <dc:date>2006-01-09T22:26:50Z</dc:date>
    </item>
    <item>
      <title>Re: comparing file date to system date</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/comparing-file-date-to-system-date/m-p/4951035#M790786</link>
      <description>Thanks John.  I was able to modify your response to get exactly what I needed.</description>
      <pubDate>Mon, 16 Jan 2006 14:47:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/comparing-file-date-to-system-date/m-p/4951035#M790786</guid>
      <dc:creator>Staci Tribelhorn</dc:creator>
      <dc:date>2006-01-16T14:47:34Z</dc:date>
    </item>
  </channel>
</rss>

