<?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: Script to clear archive log in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/script-to-clear-archive-log/m-p/3678728#M245032</link>
    <description>Try as,&lt;BR /&gt;&lt;BR /&gt;#!/bin/ksh&lt;BR /&gt;# User input -- Here&lt;BR /&gt;ARCHIVEDIR=/tmp/arcive&lt;BR /&gt;&lt;BR /&gt;cd ${ARCHIVEDIR}&lt;BR /&gt;tar -cvf /archive_$(date +%d%m%y).tar *&lt;BR /&gt;if [[ ${?} -eq 0 ]]&lt;BR /&gt;then&lt;BR /&gt;  echo "Archive of ${ARCHIVEDIR} is successful - $(date)"&lt;BR /&gt;  rm -f *&lt;BR /&gt;else&lt;BR /&gt;  echo "Archive of ${ARCHIVEDIR} is failure - $(date)"&lt;BR /&gt;  # echo "Archive ttempt again" | mailx -s "Failure" mail ID&lt;BR /&gt;fi&lt;BR /&gt;# END&lt;BR /&gt;exit 0&lt;BR /&gt;&lt;BR /&gt;Archive file will be in the format as, /archive_DDMMYY.tar file.&lt;BR /&gt;&lt;BR /&gt;hth.</description>
    <pubDate>Fri, 25 Nov 2005 04:32:52 GMT</pubDate>
    <dc:creator>Muthukumar_5</dc:creator>
    <dc:date>2005-11-25T04:32:52Z</dc:date>
    <item>
      <title>Script to clear archive log</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-to-clear-archive-log/m-p/3678725#M245029</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Currently Im running the backup of archive log using tar.&lt;BR /&gt;&lt;BR /&gt;After that manually remove the archive log files.&lt;BR /&gt;&lt;BR /&gt;Does anyone have a script to automatic tar the archive log, after that capture the files that been backup and remove it?&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 24 Nov 2005 21:48:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-to-clear-archive-log/m-p/3678725#M245029</guid>
      <dc:creator>ckchai</dc:creator>
      <dc:date>2005-11-24T21:48:04Z</dc:date>
    </item>
    <item>
      <title>Re: Script to clear archive log</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-to-clear-archive-log/m-p/3678726#M245030</link>
      <description>Hi&lt;BR /&gt;&lt;BR /&gt;Try the below script.. Modify the file names and locations accroding to your env. &lt;BR /&gt;&lt;BR /&gt;cd /archdir/&lt;BR /&gt;ls -lrt |awk '{print $9}'&amp;gt;&amp;gt;/tmp/archivelogout.`date`&lt;BR /&gt;tar -cvf /tmp/archvlog.`date`.tar *&lt;BR /&gt;for i in `cat /tmp/archivelogout.`date`&lt;BR /&gt;do&lt;BR /&gt;tar -tvf /tmp/archvlog.`date`.tar|awk '{print $8}'|grep $i&lt;BR /&gt;logs=`echo $?`&lt;BR /&gt;if [ $logs -eq 0 ]&lt;BR /&gt;then&lt;BR /&gt;rm /archdir/$i&lt;BR /&gt;else&lt;BR /&gt;echo "$i not backed up"&amp;gt;&amp;gt;/tmp/notbackedfile.`date`&lt;BR /&gt;fi&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Pls do not try this script directly as this involvs a "rm" command. !!!! :)&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Regards&lt;BR /&gt;CS&lt;BR /&gt; &lt;BR /&gt;</description>
      <pubDate>Fri, 25 Nov 2005 04:22:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-to-clear-archive-log/m-p/3678726#M245030</guid>
      <dc:creator>saju_2</dc:creator>
      <dc:date>2005-11-25T04:22:42Z</dc:date>
    </item>
    <item>
      <title>Re: Script to clear archive log</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-to-clear-archive-log/m-p/3678727#M245031</link>
      <description>Hi&lt;BR /&gt;&lt;BR /&gt;Try the below script.. Modify the file names and locations accroding to your env. &lt;BR /&gt;&lt;BR /&gt;cd /archdir/&lt;BR /&gt;ls -lrt |awk '{print $9}'&amp;gt;&amp;gt;/tmp/archivelogout.`date`&lt;BR /&gt;tar -cvf /tmp/archvlog.`date`.tar *&lt;BR /&gt;for i in `cat /tmp/archivelogout.`date`&lt;BR /&gt;do&lt;BR /&gt;tar -tvf /tmp/archvlog.`date`.tar|awk '{print $8}'|grep $i&lt;BR /&gt;logs=`echo $?`&lt;BR /&gt;if [ $logs -eq 0 ]&lt;BR /&gt;then&lt;BR /&gt;rm /archdir/$i&lt;BR /&gt;else&lt;BR /&gt;echo "$i not backed up"&amp;gt;&amp;gt;/tmp/notbackedfile.`date`&lt;BR /&gt;fi&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Pls do not try to run this without testing as it contains a "rm" command. !!!! :)&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Regards&lt;BR /&gt;CS&lt;BR /&gt; &lt;BR /&gt;</description>
      <pubDate>Fri, 25 Nov 2005 04:23:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-to-clear-archive-log/m-p/3678727#M245031</guid>
      <dc:creator>saju_2</dc:creator>
      <dc:date>2005-11-25T04:23:34Z</dc:date>
    </item>
    <item>
      <title>Re: Script to clear archive log</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-to-clear-archive-log/m-p/3678728#M245032</link>
      <description>Try as,&lt;BR /&gt;&lt;BR /&gt;#!/bin/ksh&lt;BR /&gt;# User input -- Here&lt;BR /&gt;ARCHIVEDIR=/tmp/arcive&lt;BR /&gt;&lt;BR /&gt;cd ${ARCHIVEDIR}&lt;BR /&gt;tar -cvf /archive_$(date +%d%m%y).tar *&lt;BR /&gt;if [[ ${?} -eq 0 ]]&lt;BR /&gt;then&lt;BR /&gt;  echo "Archive of ${ARCHIVEDIR} is successful - $(date)"&lt;BR /&gt;  rm -f *&lt;BR /&gt;else&lt;BR /&gt;  echo "Archive of ${ARCHIVEDIR} is failure - $(date)"&lt;BR /&gt;  # echo "Archive ttempt again" | mailx -s "Failure" mail ID&lt;BR /&gt;fi&lt;BR /&gt;# END&lt;BR /&gt;exit 0&lt;BR /&gt;&lt;BR /&gt;Archive file will be in the format as, /archive_DDMMYY.tar file.&lt;BR /&gt;&lt;BR /&gt;hth.</description>
      <pubDate>Fri, 25 Nov 2005 04:32:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-to-clear-archive-log/m-p/3678728#M245032</guid>
      <dc:creator>Muthukumar_5</dc:creator>
      <dc:date>2005-11-25T04:32:52Z</dc:date>
    </item>
  </channel>
</rss>

