<?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 Script in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/script/m-p/5051734#M96434</link>
    <description>I wanted to write a script for our daily checks &lt;BR /&gt;Things I wanted was a bdf from 3 servers and syslog.log (YESTERDAYS DATE) with only Critical errors &lt;BR /&gt;and any users who were still logged in since yesterday.&lt;BR /&gt;Can you please help. the problem I am getting is Yesterdays date&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Thu, 07 Jun 2007 07:08:10 GMT</pubDate>
    <dc:creator>Aggy</dc:creator>
    <dc:date>2007-06-07T07:08:10Z</dc:date>
    <item>
      <title>Script</title>
      <link>https://community.hpe.com/t5/operating-system-linux/script/m-p/5051734#M96434</link>
      <description>I wanted to write a script for our daily checks &lt;BR /&gt;Things I wanted was a bdf from 3 servers and syslog.log (YESTERDAYS DATE) with only Critical errors &lt;BR /&gt;and any users who were still logged in since yesterday.&lt;BR /&gt;Can you please help. the problem I am getting is Yesterdays date&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 07 Jun 2007 07:08:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/script/m-p/5051734#M96434</guid>
      <dc:creator>Aggy</dc:creator>
      <dc:date>2007-06-07T07:08:10Z</dc:date>
    </item>
    <item>
      <title>Re: Script</title>
      <link>https://community.hpe.com/t5/operating-system-linux/script/m-p/5051735#M96435</link>
      <description>Hi Aggy:&lt;BR /&gt;&lt;BR /&gt;You can parse the output of this into any pieces you want:&lt;BR /&gt;&lt;BR /&gt;# perl -le 'print scalar localtime(time-86400)'&lt;BR /&gt;&lt;BR /&gt;...or use:&lt;BR /&gt;&lt;BR /&gt;# perl -MPOSIX=strftime -le 'print strftime "%m/%d/%Y",localtime(time-86400)'&lt;BR /&gt;&lt;BR /&gt;The second snippet allows you to chose the format of the output.  The directives are the same ones available with the standard Unix 'date' command. See the manpages.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Thu, 07 Jun 2007 07:16:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/script/m-p/5051735#M96435</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2007-06-07T07:16:40Z</dc:date>
    </item>
    <item>
      <title>Re: Script</title>
      <link>https://community.hpe.com/t5/operating-system-linux/script/m-p/5051736#M96436</link>
      <description>&amp;gt;The problem I am getting is Yesterdays date.&lt;BR /&gt;&lt;BR /&gt;One solution is you put it in a file initially and then the next day you use that.  Then you put the current date, to use for the next day.&lt;BR /&gt;&lt;BR /&gt;If you skip a day, you'll end up doing everything back to the last time, that may be good or bad for you.</description>
      <pubDate>Thu, 07 Jun 2007 07:19:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/script/m-p/5051736#M96436</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2007-06-07T07:19:15Z</dc:date>
    </item>
    <item>
      <title>Re: Script</title>
      <link>https://community.hpe.com/t5/operating-system-linux/script/m-p/5051737#M96437</link>
      <description>Hello Aggy,&lt;BR /&gt;&lt;BR /&gt;This question seems to come up a lot.&lt;BR /&gt;&lt;BR /&gt;See this thread for details on how to calculate yesterday's date:&lt;BR /&gt;&lt;A href="http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=563529" target="_blank"&gt;http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=563529&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;For small date offsets, you can adjust $TZ:&lt;BR /&gt;$ YESTERDAY=$(TZ=$TZ+24 date +%Y%m%d)&lt;BR /&gt;&lt;BR /&gt;For larger offsets, there's A. Clay's Stephenson's "Date Hammer script": caljd.sh.&lt;BR /&gt;&lt;BR /&gt;PCS&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 07 Jun 2007 07:20:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/script/m-p/5051737#M96437</guid>
      <dc:creator>spex</dc:creator>
      <dc:date>2007-06-07T07:20:04Z</dc:date>
    </item>
    <item>
      <title>Re: Script</title>
      <link>https://community.hpe.com/t5/operating-system-linux/script/m-p/5051738#M96438</link>
      <description>&amp;gt; Things I wanted was a bdf from 3 servers &lt;BR /&gt;&amp;gt; and syslog.log (YESTERDAYS DATE) with only &lt;BR /&gt;&amp;gt; Critical errors and any users who were &lt;BR /&gt;&amp;gt; still logged in since yesterday.&lt;BR /&gt;&lt;BR /&gt;SLPATH=/var/adm/syslog&lt;BR /&gt;YESTERDAY1=$(TZ=$TZ+24 date +"%Y%m%d")&lt;BR /&gt;YESTERDAY2=$(TZ=$TZ+24 date +"%b %e")&lt;BR /&gt;echo [server1] bdf output:&lt;BR /&gt;bdf&lt;BR /&gt;echo [server1] critical errors from yesterday's syslog:&lt;BR /&gt;grep -i -E 'critical|&lt;KEYWORDS&gt;' ${SLPATH}/syslog.${YESTERDAY}.log&lt;BR /&gt;echo [server1] users logged in since yesterday:&lt;BR /&gt;who | grep "${YESTERDAY2}"&lt;BR /&gt;&lt;BR /&gt;echo [server2] bdf output:&lt;BR /&gt;ssh server2 bdf&lt;BR /&gt;... and so on ...&lt;BR /&gt;&lt;BR /&gt;Replace &lt;KEYWORDS&gt; above with other terms of interest from syslog, separated by a pipe ('|').&lt;BR /&gt;&lt;BR /&gt;PCS&lt;/KEYWORDS&gt;&lt;/KEYWORDS&gt;</description>
      <pubDate>Thu, 07 Jun 2007 07:40:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/script/m-p/5051738#M96438</guid>
      <dc:creator>spex</dc:creator>
      <dc:date>2007-06-07T07:40:11Z</dc:date>
    </item>
    <item>
      <title>Re: Script</title>
      <link>https://community.hpe.com/t5/operating-system-linux/script/m-p/5051739#M96439</link>
      <description>Thanks</description>
      <pubDate>Thu, 07 Jun 2007 07:51:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/script/m-p/5051739#M96439</guid>
      <dc:creator>Aggy</dc:creator>
      <dc:date>2007-06-07T07:51:34Z</dc:date>
    </item>
  </channel>
</rss>

