<?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: Using rm on file with certain date/timestamp in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/using-rm-on-file-with-certain-date-timestamp/m-p/2435593#M4843</link>
    <description>Maarten:&lt;BR /&gt;&lt;BR /&gt;Andreas approach using ll|grep|awk does not appear to work if the 'rm' command is specified with any option, like '-f'.  Using a simple 'rm' in the command string will work, however.  This, at least, on 10.20.&lt;BR /&gt;&lt;BR /&gt;If you prefer to use the more standard (less creative!) approachs, do:&lt;BR /&gt;&lt;BR /&gt;# cd /ora_arch #...or whatever for you...&lt;BR /&gt;# find *.ARC -mtime +7 -exec rm -f {} \;&lt;BR /&gt;&lt;BR /&gt;-or-&lt;BR /&gt;&lt;BR /&gt;# cd /ora_arch&lt;BR /&gt;# touch -m -t 08030000 f.$$&lt;BR /&gt;# find *.ARC -newer f.$$ -exec rm -f {} ;&lt;BR /&gt;# rm f.$$&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;BR /&gt;</description>
    <pubDate>Thu, 10 Aug 2000 12:04:30 GMT</pubDate>
    <dc:creator>James R. Ferguson</dc:creator>
    <dc:date>2000-08-10T12:04:30Z</dc:date>
    <item>
      <title>Using rm on file with certain date/timestamp</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/using-rm-on-file-with-certain-date-timestamp/m-p/2435584#M4834</link>
      <description>I want to use the rm command to delete Oracle *.ARC files if they have reached a certain age or if they are from a certain date. I tried to do this with ll *ARC |grep 'Aug  2'| rm -i but something like that doesn't work. I am probably putting the command in the wrong order but seem to be unable to figure out the correct syntax.&lt;BR /&gt;Can anyone give me a hand here ?&lt;BR /&gt;</description>
      <pubDate>Wed, 09 Aug 2000 08:11:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/using-rm-on-file-with-certain-date-timestamp/m-p/2435584#M4834</guid>
      <dc:creator>Maarten van Maanen</dc:creator>
      <dc:date>2000-08-09T08:11:52Z</dc:date>
    </item>
    <item>
      <title>Re: Using rm on file with certain date/timestamp</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/using-rm-on-file-with-certain-date-timestamp/m-p/2435585#M4835</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;i think the best is to use find:&lt;BR /&gt;Example:&lt;BR /&gt;Find all files that arte older than one week and remove them:&lt;BR /&gt;find &lt;DIR&gt; -type f -mtime +7 -exec rm -f {} \;&lt;BR /&gt;&lt;BR /&gt;help for your wish:&lt;BR /&gt;ll *ARC |grep 'Aug 2'|awk '{system("rm -f " $NF);}'&lt;BR /&gt;&lt;BR /&gt;Cheers&lt;BR /&gt;&lt;BR /&gt;Andrew&lt;BR /&gt;&lt;BR /&gt;&lt;/DIR&gt;</description>
      <pubDate>Wed, 09 Aug 2000 08:22:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/using-rm-on-file-with-certain-date-timestamp/m-p/2435585#M4835</guid>
      <dc:creator>Andreas Voss</dc:creator>
      <dc:date>2000-08-09T08:22:00Z</dc:date>
    </item>
    <item>
      <title>Re: Using rm on file with certain date/timestamp</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/using-rm-on-file-with-certain-date-timestamp/m-p/2435586#M4836</link>
      <description>find is definitely you best bet for this.&lt;BR /&gt;Either use the -mtime argument to select files a number of days old or you could use the timestamp of an existing file and use the -newerm &lt;FILE&gt; argument.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;John&lt;/FILE&gt;</description>
      <pubDate>Wed, 09 Aug 2000 08:34:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/using-rm-on-file-with-certain-date-timestamp/m-p/2435586#M4836</guid>
      <dc:creator>John Palmer</dc:creator>
      <dc:date>2000-08-09T08:34:38Z</dc:date>
    </item>
    <item>
      <title>Re: Using rm on file with certain date/timestamp</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/using-rm-on-file-with-certain-date-timestamp/m-p/2435587#M4837</link>
      <description>Maarten:&lt;BR /&gt;&lt;BR /&gt;If you choose John's method, you can always make a reference file by touch(ing) it with the timestamp you choose, as for example:&lt;BR /&gt;&lt;BR /&gt;# touch -m -t 08090606 /tmp/f&lt;BR /&gt;&lt;BR /&gt;which would create a file dated August 9, 2000 at 06:06.&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Wed, 09 Aug 2000 09:10:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/using-rm-on-file-with-certain-date-timestamp/m-p/2435587#M4837</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2000-08-09T09:10:12Z</dc:date>
    </item>
    <item>
      <title>Re: Using rm on file with certain date/timestamp</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/using-rm-on-file-with-certain-date-timestamp/m-p/2435588#M4838</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;BTW why do you remove the archive files manually ?&lt;BR /&gt;If you have OmniBack you can backup the files and remove them within the OmniBack backup specification, ie. Oracle 8:&lt;BR /&gt;rman script:&lt;BR /&gt;....&lt;BR /&gt;"archivelog all delete input"&lt;BR /&gt;";"&lt;BR /&gt;.....&lt;BR /&gt;&lt;BR /&gt;Regards&lt;BR /&gt;&lt;BR /&gt;Andrew</description>
      <pubDate>Wed, 09 Aug 2000 11:33:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/using-rm-on-file-with-certain-date-timestamp/m-p/2435588#M4838</guid>
      <dc:creator>Andreas Voss</dc:creator>
      <dc:date>2000-08-09T11:33:45Z</dc:date>
    </item>
    <item>
      <title>Re: Using rm on file with certain date/timestamp</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/using-rm-on-file-with-certain-date-timestamp/m-p/2435589#M4839</link>
      <description>Am trying to use find but don't seem to get it working&lt;BR /&gt;Directory of logfiles is: /logdisk01/oradata/arch/C2P#. The old files have a .ARC extension.&lt;BR /&gt;&lt;BR /&gt;Example listing:&lt;BR /&gt;rw-r-----   1 oracle     users      52429824 Aug  9 15:01 T0001S0000012927.ARC&lt;BR /&gt;-rw-r-----   1 oracle     users      52429824 Aug  9 15:05 T0001S0000012928.ARC&lt;BR /&gt;-rw-r-----   1 oracle     users      52429824 Aug  9 15:11 T0001S0000012929.ARC&lt;BR /&gt;&lt;BR /&gt;I go there with cd and do a find . -name *ARC and get nothing.&lt;BR /&gt;If I do a find ./ -name T* I get:&lt;BR /&gt;find: missing conjunction.&lt;BR /&gt;&lt;BR /&gt;What am I missing here ??&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 09 Aug 2000 12:28:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/using-rm-on-file-with-certain-date-timestamp/m-p/2435589#M4839</guid>
      <dc:creator>Maarten van Maanen</dc:creator>
      <dc:date>2000-08-09T12:28:52Z</dc:date>
    </item>
    <item>
      <title>Re: Using rm on file with certain date/timestamp</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/using-rm-on-file-with-certain-date-timestamp/m-p/2435590#M4840</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;if you are using metachars like * within find you have to quote this:&lt;BR /&gt;find ./ -name 'T*'&lt;BR /&gt;&lt;BR /&gt;Regards&lt;BR /&gt;&lt;BR /&gt;Andrew &lt;BR /&gt;</description>
      <pubDate>Wed, 09 Aug 2000 12:38:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/using-rm-on-file-with-certain-date-timestamp/m-p/2435590#M4840</guid>
      <dc:creator>Andreas Voss</dc:creator>
      <dc:date>2000-08-09T12:38:29Z</dc:date>
    </item>
    <item>
      <title>Re: Using rm on file with certain date/timestamp</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/using-rm-on-file-with-certain-date-timestamp/m-p/2435591#M4841</link>
      <description>Or escape them with a backslash character.&lt;BR /&gt;&lt;BR /&gt;E.g find . -name T!*&lt;BR /&gt;(read the backslash character for ! above).&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;John&lt;BR /&gt; \ \</description>
      <pubDate>Wed, 09 Aug 2000 16:13:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/using-rm-on-file-with-certain-date-timestamp/m-p/2435591#M4841</guid>
      <dc:creator>John Palmer</dc:creator>
      <dc:date>2000-08-09T16:13:57Z</dc:date>
    </item>
    <item>
      <title>Re: Using rm on file with certain date/timestamp</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/using-rm-on-file-with-certain-date-timestamp/m-p/2435592#M4842</link>
      <description>Hi Maarten,&lt;BR /&gt;If you wish to use ll, then in order to get rid of whats before the filename you will have to use cmd cut:&lt;BR /&gt;# rm $(ll | grep " Aug  2" | cut -c 58-80)&lt;BR /&gt;But remember, in this the spaces of what is in between your doublequotes are important:&lt;BR /&gt;"Aug 2" vs " Aug  2 " (2 spaces between b &amp;amp; 2)&lt;BR /&gt;&lt;BR /&gt;Hope this helps&lt;BR /&gt;Greetings&lt;BR /&gt;Victor</description>
      <pubDate>Thu, 10 Aug 2000 08:33:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/using-rm-on-file-with-certain-date-timestamp/m-p/2435592#M4842</guid>
      <dc:creator>Victor BERRIDGE</dc:creator>
      <dc:date>2000-08-10T08:33:34Z</dc:date>
    </item>
    <item>
      <title>Re: Using rm on file with certain date/timestamp</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/using-rm-on-file-with-certain-date-timestamp/m-p/2435593#M4843</link>
      <description>Maarten:&lt;BR /&gt;&lt;BR /&gt;Andreas approach using ll|grep|awk does not appear to work if the 'rm' command is specified with any option, like '-f'.  Using a simple 'rm' in the command string will work, however.  This, at least, on 10.20.&lt;BR /&gt;&lt;BR /&gt;If you prefer to use the more standard (less creative!) approachs, do:&lt;BR /&gt;&lt;BR /&gt;# cd /ora_arch #...or whatever for you...&lt;BR /&gt;# find *.ARC -mtime +7 -exec rm -f {} \;&lt;BR /&gt;&lt;BR /&gt;-or-&lt;BR /&gt;&lt;BR /&gt;# cd /ora_arch&lt;BR /&gt;# touch -m -t 08030000 f.$$&lt;BR /&gt;# find *.ARC -newer f.$$ -exec rm -f {} ;&lt;BR /&gt;# rm f.$$&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;BR /&gt;</description>
      <pubDate>Thu, 10 Aug 2000 12:04:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/using-rm-on-file-with-certain-date-timestamp/m-p/2435593#M4843</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2000-08-10T12:04:30Z</dc:date>
    </item>
    <item>
      <title>Re: Using rm on file with certain date/timestamp</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/using-rm-on-file-with-certain-date-timestamp/m-p/2435594#M4844</link>
      <description>Maarten:&lt;BR /&gt;&lt;BR /&gt;OOPS. Look carefully at Andreas' example.  The "rm -f " syntax works perfectly fine if you put a BLANK after the 'f' and before the quote (OBVIOUSLY!!!).  My apologies for any confusion.&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Thu, 10 Aug 2000 13:20:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/using-rm-on-file-with-certain-date-timestamp/m-p/2435594#M4844</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2000-08-10T13:20:28Z</dc:date>
    </item>
  </channel>
</rss>

