<?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 Deleteing archive files in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/deleteing-archive-files/m-p/4258516#M332610</link>
    <description>I have filled with lots archive files in the directory /u01/archives&lt;BR /&gt;&lt;BR /&gt;It is increasing every day. But i need to write a bash/perl script and put it in crot tab. The logic is&lt;BR /&gt;&lt;BR /&gt;To check the disk utilization of /u01/archives if it exceeds 80%, then delete the archive files.&lt;BR /&gt;&lt;BR /&gt;Does anyone has this in your environment. How do you manage archive files ? Please share your automation in your env. plz... &lt;BR /&gt;&lt;BR /&gt;Points Points....&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;gV</description>
    <pubDate>Wed, 27 Aug 2008 06:27:46 GMT</pubDate>
    <dc:creator>Gops_1</dc:creator>
    <dc:date>2008-08-27T06:27:46Z</dc:date>
    <item>
      <title>Deleteing archive files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/deleteing-archive-files/m-p/4258516#M332610</link>
      <description>I have filled with lots archive files in the directory /u01/archives&lt;BR /&gt;&lt;BR /&gt;It is increasing every day. But i need to write a bash/perl script and put it in crot tab. The logic is&lt;BR /&gt;&lt;BR /&gt;To check the disk utilization of /u01/archives if it exceeds 80%, then delete the archive files.&lt;BR /&gt;&lt;BR /&gt;Does anyone has this in your environment. How do you manage archive files ? Please share your automation in your env. plz... &lt;BR /&gt;&lt;BR /&gt;Points Points....&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;gV</description>
      <pubDate>Wed, 27 Aug 2008 06:27:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/deleteing-archive-files/m-p/4258516#M332610</guid>
      <dc:creator>Gops_1</dc:creator>
      <dc:date>2008-08-27T06:27:46Z</dc:date>
    </item>
    <item>
      <title>Re: Deleteing archive files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/deleteing-archive-files/m-p/4258517#M332611</link>
      <description>Hi Gops&lt;BR /&gt;&lt;BR /&gt;You can add enrty in Cron which will find files on this FS which will clear/Zip the logs for some time old say 30 days&lt;BR /&gt;&lt;BR /&gt;Entry in Cron&lt;BR /&gt;&lt;BR /&gt;15 00 * * * /usr/bin/find /u01/archives  -type f -mtime +30 -exec /usr/bin/compress {} \;&lt;BR /&gt;it will compress files&lt;BR /&gt;&lt;BR /&gt;to delete tham&lt;BR /&gt;&lt;BR /&gt;30 00 * * * /usr/bin/find /u01/archives   -type f -mtime +90 -exec /usr/bin/rm {} \;&lt;BR /&gt;&lt;BR /&gt;Regards&lt;BR /&gt;Sanjeev</description>
      <pubDate>Wed, 27 Aug 2008 06:42:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/deleteing-archive-files/m-p/4258517#M332611</guid>
      <dc:creator>Sharma Sanjeev</dc:creator>
      <dc:date>2008-08-27T06:42:53Z</dc:date>
    </item>
    <item>
      <title>Re: Deleteing archive files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/deleteing-archive-files/m-p/4258518#M332612</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;You can start with utilisation check&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;bdf /u01/archives |grep "80%"&lt;BR /&gt;if [$i==0]&lt;BR /&gt;&lt;BR /&gt;find files to be deleted&lt;BR /&gt;remove files&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 27 Aug 2008 07:00:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/deleteing-archive-files/m-p/4258518#M332612</guid>
      <dc:creator>Deepak Kr</dc:creator>
      <dc:date>2008-08-27T07:00:06Z</dc:date>
    </item>
    <item>
      <title>Re: Deleteing archive files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/deleteing-archive-files/m-p/4258519#M332613</link>
      <description>Also provide cron requirements so that we can help you!!&lt;BR /&gt;&lt;BR /&gt;Crontab syntax :-&lt;BR /&gt;&lt;BR /&gt;A crontab file has five fields for specifying day , date and time  followed by the command to be run at that interval.&lt;BR /&gt;&lt;BR /&gt;*     *   *   *    *  command to be executed&lt;BR /&gt;-     -    -    -    -&lt;BR /&gt;|     |     |     |     |&lt;BR /&gt;|     |     |     |     +----- day of week (0 - 6) (Sunday=0)&lt;BR /&gt;|     |     |     +------- month (1 - 12)&lt;BR /&gt;|     |     +--------- day of month (1 - 31)&lt;BR /&gt;|     +----------- hour (0 - 23)&lt;BR /&gt;+------------- min (0 - 59)&lt;BR /&gt; &lt;BR /&gt;</description>
      <pubDate>Wed, 27 Aug 2008 07:05:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/deleteing-archive-files/m-p/4258519#M332613</guid>
      <dc:creator>Deepak Kr</dc:creator>
      <dc:date>2008-08-27T07:05:12Z</dc:date>
    </item>
    <item>
      <title>Re: Deleteing archive files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/deleteing-archive-files/m-p/4258520#M332614</link>
      <description>&amp;gt;To check the disk utilization of /u01/archives if it exceeds 80%, then delete the archive files.&lt;BR /&gt;&lt;BR /&gt;If you put on cron on a daily/hourly basis, this might help.&lt;BR /&gt;&lt;BR /&gt;while bdf /u01/archives |grep '8[0-9]%'&lt;BR /&gt;do&lt;BR /&gt;ls $(ls -1rt /u01/archives/*|head -1)&lt;BR /&gt;exit&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&amp;gt;ls $(ls -1rt /u01/archives/*|head -1)&lt;BR /&gt;&lt;BR /&gt;-replace the first ls with rm to remove&lt;BR /&gt;-head -1 is taking the oldest file from the sorted by date list. &lt;BR /&gt;increase the number for the number of files you want to remove as per your requirement. You have to make the cron either hourly or daily/weekly as per your data growth.&lt;BR /&gt;&lt;BR /&gt;Regards.</description>
      <pubDate>Wed, 27 Aug 2008 12:48:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/deleteing-archive-files/m-p/4258520#M332614</guid>
      <dc:creator>Rasheed Tamton</dc:creator>
      <dc:date>2008-08-27T12:48:36Z</dc:date>
    </item>
    <item>
      <title>Re: Deleteing archive files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/deleteing-archive-files/m-p/4258521#M332615</link>
      <description>Hi,&lt;BR /&gt;Please read the following document, may be usefull...&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://docs.hp.com/en/5991-0662/5991-0662.pdf" target="_blank"&gt;http://docs.hp.com/en/5991-0662/5991-0662.pdf&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;â  Task 1: Backing Up Your Data Filesâ  &lt;BR /&gt;&lt;BR /&gt;â  Task 2: Creating an Operating System Recovery Archiveâ  &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Gokul Chandola</description>
      <pubDate>Thu, 30 Oct 2008 08:27:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/deleteing-archive-files/m-p/4258521#M332615</guid>
      <dc:creator>Gokul Chandola</dc:creator>
      <dc:date>2008-10-30T08:27:50Z</dc:date>
    </item>
    <item>
      <title>Re: Deleteing archive files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/deleteing-archive-files/m-p/4258522#M332616</link>
      <description>&lt;!--!*#--&gt;&amp;gt;if it exceeds 80%, then delete the archive files.&lt;BR /&gt;&lt;BR /&gt;Delete all?  Or only older ones until below X%?&lt;BR /&gt;&lt;BR /&gt;&amp;gt;Sanjeev: 15 00 * * * /usr/bin/find /u01/archives -type f -mtime +30 -exec /usr/bin/compress {} \;&lt;BR /&gt;&lt;BR /&gt;You can improve it by using gzip and skipping files that were gzipped:&lt;BR /&gt;find /u01/archives -type f ! name "*.gz" -mtime +30 -exec gzip {} +&lt;BR /&gt;&lt;BR /&gt;And speed up the rm:&lt;BR /&gt;find /u01/archives -type f -mtime +90 -exec rm -f {} +&lt;BR /&gt;&lt;BR /&gt;Checking if &amp;gt; 80%:&lt;BR /&gt;if [ $(bdf /u01/archives | awk '/% / {print $(NF-1)+0}') -gt 80 ]; then&lt;BR /&gt;   echo "greater than 80"&lt;BR /&gt;fi&lt;BR /&gt;</description>
      <pubDate>Thu, 30 Oct 2008 08:51:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/deleteing-archive-files/m-p/4258522#M332616</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2008-10-30T08:51:29Z</dc:date>
    </item>
  </channel>
</rss>

