<?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 HELP in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/4607394#M376404</link>
    <description>I need script that send email when my ftpscript fail for some reason Now every thing work fine.&lt;BR /&gt;My Script search error from logs:&lt;BR /&gt;---------------------------------&lt;BR /&gt;#Move last LOG to OLD&lt;BR /&gt;mv /tmp/logschk.txt /tmp/logschk.txt.OLD&lt;BR /&gt;&amp;gt;/tmp/logschk.txt # Touch file LOG&lt;BR /&gt;-------------------------------------&lt;BR /&gt;#LOG env arch.&lt;BR /&gt;export LOG=/tmp/logschk.txt&lt;BR /&gt;-----------------------------&lt;BR /&gt;# env for my parent error search criterial (no such file etc...)&lt;BR /&gt;&lt;BR /&gt;export ERRORES=/tmp/chkctrl.txt&lt;BR /&gt;------------------------------------------&lt;BR /&gt;# Find error w/match parten file and create result in LOG file &lt;BR /&gt;grep -f $ERRORES /tmp/ftp* 0&amp;gt;&amp;gt;$LOG&lt;BR /&gt;--------------------------------------&lt;BR /&gt;#Send email w/attach (logschk.txt attach name) with match errors to alias user call " test"&lt;BR /&gt;&lt;BR /&gt;uuencode $LOG logschk.txt |mailx -s 'Falla FtpServicio' test&lt;BR /&gt;&lt;BR /&gt;I made the above script to find and send some error ocurred if match with a parent file that I need verify. if this no match happen the script send a empty email.&lt;BR /&gt;&lt;BR /&gt;I need send email only when some grep match with parent file other ways nothing happend.&lt;BR /&gt;&lt;BR /&gt;rigth now all way send email but i need send when only have match with my parten file&lt;BR /&gt;&lt;BR /&gt;Pls, a little help with my limited &lt;BR /&gt;&lt;BR /&gt;Thsk every one.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Thu, 25 Mar 2010 17:13:39 GMT</pubDate>
    <dc:creator>Isaac_4</dc:creator>
    <dc:date>2010-03-25T17:13:39Z</dc:date>
    <item>
      <title>Script HELP</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/4607394#M376404</link>
      <description>I need script that send email when my ftpscript fail for some reason Now every thing work fine.&lt;BR /&gt;My Script search error from logs:&lt;BR /&gt;---------------------------------&lt;BR /&gt;#Move last LOG to OLD&lt;BR /&gt;mv /tmp/logschk.txt /tmp/logschk.txt.OLD&lt;BR /&gt;&amp;gt;/tmp/logschk.txt # Touch file LOG&lt;BR /&gt;-------------------------------------&lt;BR /&gt;#LOG env arch.&lt;BR /&gt;export LOG=/tmp/logschk.txt&lt;BR /&gt;-----------------------------&lt;BR /&gt;# env for my parent error search criterial (no such file etc...)&lt;BR /&gt;&lt;BR /&gt;export ERRORES=/tmp/chkctrl.txt&lt;BR /&gt;------------------------------------------&lt;BR /&gt;# Find error w/match parten file and create result in LOG file &lt;BR /&gt;grep -f $ERRORES /tmp/ftp* 0&amp;gt;&amp;gt;$LOG&lt;BR /&gt;--------------------------------------&lt;BR /&gt;#Send email w/attach (logschk.txt attach name) with match errors to alias user call " test"&lt;BR /&gt;&lt;BR /&gt;uuencode $LOG logschk.txt |mailx -s 'Falla FtpServicio' test&lt;BR /&gt;&lt;BR /&gt;I made the above script to find and send some error ocurred if match with a parent file that I need verify. if this no match happen the script send a empty email.&lt;BR /&gt;&lt;BR /&gt;I need send email only when some grep match with parent file other ways nothing happend.&lt;BR /&gt;&lt;BR /&gt;rigth now all way send email but i need send when only have match with my parten file&lt;BR /&gt;&lt;BR /&gt;Pls, a little help with my limited &lt;BR /&gt;&lt;BR /&gt;Thsk every one.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 25 Mar 2010 17:13:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/4607394#M376404</guid>
      <dc:creator>Isaac_4</dc:creator>
      <dc:date>2010-03-25T17:13:39Z</dc:date>
    </item>
    <item>
      <title>Re: Script HELP</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/4607395#M376405</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;One way is to test your '$LOG' file for a non-zero size:&lt;BR /&gt;&lt;BR /&gt;if [ -s ${LOG} ]; then&lt;BR /&gt;    uuencode ...&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;...This test returns true only if the file exists and has a size greater than zero.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Thu, 25 Mar 2010 18:15:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/4607395#M376405</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2010-03-25T18:15:46Z</dc:date>
    </item>
    <item>
      <title>Re: Script HELP</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/4607396#M376406</link>
      <description>&lt;!--!*#--&gt;Hi,&lt;BR /&gt;you could:&lt;BR /&gt;------------------------------------------&lt;BR /&gt;# Find error w/match parten file and create result in LOG file &lt;BR /&gt;N_ERRORES=$(grep -c $ERRORES /tmp/ftp*)&lt;BR /&gt;if [[ $N_ERRORES &amp;gt; 0 ]]; then&lt;BR /&gt;   grep -f $ERRORES /tmp/ftp* 0&amp;gt;&amp;gt;$LOG&lt;BR /&gt;   #Send email w/attach (logschk.txt attach  name) with match errors to alias user call " test"&lt;BR /&gt;&lt;BR /&gt;   uuencode $LOG logschk.txt |mailx -s 'Falla ($N_ERRORES) FtpServicio' test&lt;BR /&gt;&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;in this way you will have the number of the error in the subject of the mail as well.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;HTH,&lt;BR /&gt;Art&lt;BR /&gt;</description>
      <pubDate>Fri, 26 Mar 2010 07:01:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/4607396#M376406</guid>
      <dc:creator>Arturo Galbiati</dc:creator>
      <dc:date>2010-03-26T07:01:00Z</dc:date>
    </item>
  </channel>
</rss>

