<?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: filedate in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/filedate/m-p/2919999#M109271</link>
    <description>Thanks to all the assistance!&lt;BR /&gt;Neither of these was exactly what I was looking for. I think you cannot really deside with shell scripts if a file is older than X seconds (X is configureble parameter) or not. Or at least is too complicated:)&lt;BR /&gt;I wrote a little C code and attached. Feel free to use it...&lt;BR /&gt;Usage: filedate [-f filename] [-d duration] [-p] [-h]&lt;BR /&gt;        -d duration     exit code 1 if file older than specified duration&lt;BR /&gt;                        duration is in sec. default is 12 hours.&lt;BR /&gt;        -f filename     Checks the data modification date of the specific file&lt;BR /&gt;        -h              Wot d'ya think? :-)&lt;BR /&gt;        -p              Prints the date of the file in %c%y/%m/%d %H:%M:%S&lt;BR /&gt;</description>
    <pubDate>Fri, 07 Mar 2003 13:10:31 GMT</pubDate>
    <dc:creator>Laszlo Csizmadia</dc:creator>
    <dc:date>2003-03-07T13:10:31Z</dc:date>
    <item>
      <title>filedate</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/filedate/m-p/2919992#M109264</link>
      <description>Must be a trivial question...&lt;BR /&gt;but how to determine a file creation date in seconds? Is there one command like filedate in solaris? I want to delete some files older than 30 minutes. Find's -ctime only accepts days.&lt;BR /&gt;Thanks in advance.</description>
      <pubDate>Wed, 05 Mar 2003 17:19:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/filedate/m-p/2919992#M109264</guid>
      <dc:creator>Laszlo Csizmadia</dc:creator>
      <dc:date>2003-03-05T17:19:08Z</dc:date>
    </item>
    <item>
      <title>Re: filedate</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/filedate/m-p/2919993#M109265</link>
      <description>Use the touch command to create a reference file, then use the -newer option of find.&lt;BR /&gt;&lt;BR /&gt;Pete</description>
      <pubDate>Wed, 05 Mar 2003 17:22:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/filedate/m-p/2919993#M109265</guid>
      <dc:creator>Pete Randall</dc:creator>
      <dc:date>2003-03-05T17:22:47Z</dc:date>
    </item>
    <item>
      <title>Re: filedate</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/filedate/m-p/2919994#M109266</link>
      <description>Something like this may work for you.&lt;BR /&gt;&lt;BR /&gt;find . -mtime +1 -exec rm {} \;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;This would delete everything older than one day.&lt;BR /&gt;</description>
      <pubDate>Wed, 05 Mar 2003 20:23:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/filedate/m-p/2919994#M109266</guid>
      <dc:creator>Paul Sperry</dc:creator>
      <dc:date>2003-03-05T20:23:00Z</dc:date>
    </item>
    <item>
      <title>Re: filedate</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/filedate/m-p/2919995#M109267</link>
      <description>do not know about filedate but a little lengthy way is to get the inode of file by ls -lai and then:&lt;BR /&gt;&lt;BR /&gt;echo 12345i |fsdb /dev/vgxx/lvolX&lt;BR /&gt;&lt;BR /&gt;where 12345 is your inode number of file.&lt;BR /&gt;&lt;BR /&gt;This will tell ctime.mtime atime which you can grep for doing stuff,&lt;BR /&gt;&lt;BR /&gt;But I will agree with earlier approach of touching a file and then using -newer option in find...&lt;BR /&gt;&lt;BR /&gt;hope this helps..</description>
      <pubDate>Wed, 05 Mar 2003 23:55:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/filedate/m-p/2919995#M109267</guid>
      <dc:creator>monasingh_1</dc:creator>
      <dc:date>2003-03-05T23:55:39Z</dc:date>
    </item>
    <item>
      <title>Re: filedate</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/filedate/m-p/2919996#M109268</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Pete's method can be used to achive your task.&lt;BR /&gt;&lt;BR /&gt;Create a file by touching it with a timestamp of 30mins back. Then use find with -newer option.&lt;BR /&gt;&lt;BR /&gt;$touch 0305173003 myreference&lt;BR /&gt;&lt;BR /&gt;This creates the file myreference stamped with 17:30 hrs today. &lt;BR /&gt;&lt;BR /&gt;$find /dir -newer myreference&lt;BR /&gt;&lt;BR /&gt;Use it with exec or xargs to delete the thus found files.&lt;BR /&gt;&lt;BR /&gt;-Sri &lt;BR /&gt;</description>
      <pubDate>Thu, 06 Mar 2003 00:04:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/filedate/m-p/2919996#M109268</guid>
      <dc:creator>Sridhar Bhaskarla</dc:creator>
      <dc:date>2003-03-06T00:04:37Z</dc:date>
    </item>
    <item>
      <title>Re: filedate</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/filedate/m-p/2919997#M109269</link>
      <description>Hi,&lt;BR /&gt;Yes there are ways to find the time of file in seconds but not a straight one. You'll have to write a C program using stat() function and extract st_mtime in structure stat.&lt;BR /&gt;&lt;BR /&gt;Let me know if you need the codes i have for this.&lt;BR /&gt;&lt;BR /&gt;Rajeev</description>
      <pubDate>Thu, 06 Mar 2003 01:36:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/filedate/m-p/2919997#M109269</guid>
      <dc:creator>Rajeev  Shukla</dc:creator>
      <dc:date>2003-03-06T01:36:30Z</dc:date>
    </item>
    <item>
      <title>Re: filedate</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/filedate/m-p/2919998#M109270</link>
      <description>Hi Laszlo,&lt;BR /&gt;attached is something similar I once did myself. The attachment consists of two scripts. &lt;BR /&gt;The following variables of the first script must be configured:&lt;BR /&gt;RETURN_SECONDS must point to the second script in the attachment!&lt;BR /&gt;DIR must specify the directory starting point under which the files are to be deleted.&lt;BR /&gt;AGE must specify in seconds how old the files are allowed to be.&lt;BR /&gt;&lt;BR /&gt;The first script, which is the one you must execute, tries to convert passed seconds into a more user-friendly date format: the month is expressed as three chars, e.g. May or Maj or something else (language dependent). As I do not know which language you use, the script may not  make the correct mapping and might  therefore fail. Hope you can correct this yourself in the case sentence.&lt;BR /&gt;The script makes use of the find command:&lt;BR /&gt;! -newer&lt;BR /&gt;which means "older than". If you are 100% sure that you get hold of  the correct files, you can change the ls -l to rm in the find command. Be really careful.&lt;BR /&gt;&lt;BR /&gt;regards,&lt;BR /&gt;John K.</description>
      <pubDate>Thu, 06 Mar 2003 12:26:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/filedate/m-p/2919998#M109270</guid>
      <dc:creator>john korterman</dc:creator>
      <dc:date>2003-03-06T12:26:00Z</dc:date>
    </item>
    <item>
      <title>Re: filedate</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/filedate/m-p/2919999#M109271</link>
      <description>Thanks to all the assistance!&lt;BR /&gt;Neither of these was exactly what I was looking for. I think you cannot really deside with shell scripts if a file is older than X seconds (X is configureble parameter) or not. Or at least is too complicated:)&lt;BR /&gt;I wrote a little C code and attached. Feel free to use it...&lt;BR /&gt;Usage: filedate [-f filename] [-d duration] [-p] [-h]&lt;BR /&gt;        -d duration     exit code 1 if file older than specified duration&lt;BR /&gt;                        duration is in sec. default is 12 hours.&lt;BR /&gt;        -f filename     Checks the data modification date of the specific file&lt;BR /&gt;        -h              Wot d'ya think? :-)&lt;BR /&gt;        -p              Prints the date of the file in %c%y/%m/%d %H:%M:%S&lt;BR /&gt;</description>
      <pubDate>Fri, 07 Mar 2003 13:10:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/filedate/m-p/2919999#M109271</guid>
      <dc:creator>Laszlo Csizmadia</dc:creator>
      <dc:date>2003-03-07T13:10:31Z</dc:date>
    </item>
    <item>
      <title>Re: filedate</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/filedate/m-p/2920000#M109272</link>
      <description>Although you can use the stat() syscall and do more or less weird calculations this is straight forward in Perl.&lt;BR /&gt;&lt;BR /&gt;Remember that the -M test takes the seconds since the epoch when your script started and substracts the file's mtime in seconds since the epoch, and returns the value in days.&lt;BR /&gt;&lt;BR /&gt;(this is much better explained in the POD, type "perldoc -f -x")&lt;BR /&gt;&lt;BR /&gt;So a oneliner to demostrate:&lt;BR /&gt;&lt;BR /&gt;# touch /tmp/smp;sleep 12; perl -e '$t=-M "/tmp/smp";print $t*=86400,"\n"'&lt;BR /&gt;12&lt;BR /&gt;</description>
      <pubDate>Fri, 07 Mar 2003 20:32:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/filedate/m-p/2920000#M109272</guid>
      <dc:creator>Ralph Grothe</dc:creator>
      <dc:date>2003-03-07T20:32:29Z</dc:date>
    </item>
  </channel>
</rss>

