<?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: Need Help in  a Script in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/need-help-in-a-script/m-p/2550857#M28088</link>
    <description>Thanks. I really appriciate your help.&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Tue, 10 Jul 2001 17:26:37 GMT</pubDate>
    <dc:creator>Uday_S_Ankolekar</dc:creator>
    <dc:date>2001-07-10T17:26:37Z</dc:date>
    <item>
      <title>Need Help in  a Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/need-help-in-a-script/m-p/2550851#M28082</link>
      <description>&lt;BR /&gt;I want to check possible warning messages from syslog file for the last seven days.&lt;BR /&gt;I'm using grep command to match the words like Error, Warning, Fail etc..&lt;BR /&gt;This is my command in script.&lt;BR /&gt;grep -Ei "err|warn|panic|crit|fail" /var/adm/syslog/syslog.log&lt;BR /&gt; I also want to ignore some words those have 'err' letters( Ex.RFErr ) How can I do this in a single grep command??.&lt;BR /&gt;And I would like to check syslog file for these errors only for last seven days. &lt;BR /&gt;&lt;BR /&gt;Thanks in Advance&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 10 Jul 2001 16:13:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/need-help-in-a-script/m-p/2550851#M28082</guid>
      <dc:creator>Uday_S_Ankolekar</dc:creator>
      <dc:date>2001-07-10T16:13:54Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help in  a Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/need-help-in-a-script/m-p/2550852#M28083</link>
      <description>Hi&lt;BR /&gt;&lt;BR /&gt;grep -v &lt;WORD&gt; will ignore.&lt;BR /&gt;&lt;BR /&gt;See man grep&lt;BR /&gt;&lt;BR /&gt;HTH&lt;BR /&gt;&lt;BR /&gt;Paula&lt;/WORD&gt;</description>
      <pubDate>Tue, 10 Jul 2001 16:18:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/need-help-in-a-script/m-p/2550852#M28083</guid>
      <dc:creator>Paula J Frazer-Campbell</dc:creator>
      <dc:date>2001-07-10T16:18:58Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help in  a Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/need-help-in-a-script/m-p/2550853#M28084</link>
      <description>Here's a little script that will check for some things I like to be alerted for...I have it email me the message when it finds one.&lt;BR /&gt;Modify it as you may want...if you like it.&lt;BR /&gt;&lt;BR /&gt;I set the job up and cron'd it to check the syslog file every 10 minutes...&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Rita</description>
      <pubDate>Tue, 10 Jul 2001 16:25:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/need-help-in-a-script/m-p/2550853#M28084</guid>
      <dc:creator>Rita C Workman</dc:creator>
      <dc:date>2001-07-10T16:25:11Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help in  a Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/need-help-in-a-script/m-p/2550854#M28085</link>
      <description>Hi&lt;BR /&gt;cat file |grep -v "word" &lt;BR /&gt;&lt;BR /&gt;Sachin</description>
      <pubDate>Tue, 10 Jul 2001 16:29:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/need-help-in-a-script/m-p/2550854#M28085</guid>
      <dc:creator>Sachin Patel</dc:creator>
      <dc:date>2001-07-10T16:29:50Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help in  a Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/need-help-in-a-script/m-p/2550855#M28086</link>
      <description>Hi&lt;BR /&gt;To check the log file over a specific period of days then you will have to calculate the date "X" days ago, attached is a script which when run as:-  &amp;lt;scriptname&amp;gt; x &lt;BR /&gt;x being the number of days in the past you require will return that date you can then grep out what you require from that date forward.&lt;BR /&gt;&lt;BR /&gt;Script is one that Tom Danzig posted a while ago. - Thanks Tom.&lt;BR /&gt;&lt;BR /&gt;In your script;-&lt;BR /&gt;&lt;BR /&gt;&lt;DATEWHEN&gt; 7 - use result to grep out.&lt;BR /&gt;&lt;DATEWHEN&gt; 6 - use result to grep out.&lt;BR /&gt;&lt;DATEWHEN&gt; 5 - use result to grep out.&lt;BR /&gt;&lt;BR /&gt;And so on.&lt;BR /&gt;&lt;BR /&gt;Just an idea&lt;BR /&gt;&lt;BR /&gt;Paula&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;This scrip was from Tom danzig&lt;BR /&gt;&lt;BR /&gt;&lt;/DATEWHEN&gt;&lt;/DATEWHEN&gt;&lt;/DATEWHEN&gt;</description>
      <pubDate>Tue, 10 Jul 2001 16:32:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/need-help-in-a-script/m-p/2550855#M28086</guid>
      <dc:creator>Paula J Frazer-Campbell</dc:creator>
      <dc:date>2001-07-10T16:32:30Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help in  a Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/need-help-in-a-script/m-p/2550856#M28087</link>
      <description>grep -Ei "err|warn|panic|crit|fail" /var/adm/syslog/syslog.log  | grep -v -i err &amp;gt; /tmp/syslogerr.txt&lt;BR /&gt;&lt;BR /&gt; For grepping errors for last sevendays u need to write a script for that by grepping fileds in date command and decrese the day value for each previous day. You can't do that in single grep command.&lt;BR /&gt;&lt;BR /&gt;I have attached a script for 2 days(today and yesterday.&lt;BR /&gt;&lt;BR /&gt;Cheers...&lt;BR /&gt;satish.</description>
      <pubDate>Tue, 10 Jul 2001 16:41:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/need-help-in-a-script/m-p/2550856#M28087</guid>
      <dc:creator>Satish Y</dc:creator>
      <dc:date>2001-07-10T16:41:17Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help in  a Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/need-help-in-a-script/m-p/2550857#M28088</link>
      <description>Thanks. I really appriciate your help.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 10 Jul 2001 17:26:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/need-help-in-a-script/m-p/2550857#M28088</guid>
      <dc:creator>Uday_S_Ankolekar</dc:creator>
      <dc:date>2001-07-10T17:26:37Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help in  a Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/need-help-in-a-script/m-p/2550858#M28089</link>
      <description>Hi Uday,&lt;BR /&gt;&lt;BR /&gt;1 ) You can use the find command joint the&lt;BR /&gt;mtime parameter for make a copy of file syslog.log older than 7 days.&lt;BR /&gt;&lt;BR /&gt;2 ) Later, use the grep command in this copy.&lt;BR /&gt;&lt;BR /&gt;I Don?t remember the find syntaxe.&lt;BR /&gt;&lt;BR /&gt;Anybody remember ??&lt;BR /&gt;&lt;BR /&gt;more less : find /var/adm/syslog/syslog.log -mtime +7 -exec cp......\;&lt;BR /&gt;&lt;BR /&gt;I hope this help !&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;Abel Berger&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 10 Jul 2001 19:40:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/need-help-in-a-script/m-p/2550858#M28089</guid>
      <dc:creator>Abel Berger</dc:creator>
      <dc:date>2001-07-10T19:40:28Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help in  a Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/need-help-in-a-script/m-p/2550859#M28090</link>
      <description>Abel,&lt;BR /&gt;You can use find with -depth. the proper syntex would be&lt;BR /&gt;&lt;BR /&gt;find -depth -mtime +7 -exec &lt;BR /&gt;&lt;BR /&gt;Thanks thou...</description>
      <pubDate>Tue, 10 Jul 2001 19:46:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/need-help-in-a-script/m-p/2550859#M28090</guid>
      <dc:creator>Uday_S_Ankolekar</dc:creator>
      <dc:date>2001-07-10T19:46:45Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help in  a Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/need-help-in-a-script/m-p/2550860#M28091</link>
      <description>grep -Ei "[^a-z]err[^a-n,p-z]|warn|panic|crit|fail"&lt;BR /&gt;&lt;BR /&gt;will match on "err" or "error" but not, say, "interrupt"&lt;BR /&gt;&lt;BR /&gt;Robin.</description>
      <pubDate>Wed, 11 Jul 2001 06:23:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/need-help-in-a-script/m-p/2550860#M28091</guid>
      <dc:creator>Robin Wakefield</dc:creator>
      <dc:date>2001-07-11T06:23:29Z</dc:date>
    </item>
  </channel>
</rss>

