<?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: conditional mail on find? in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/conditional-mail-on-find/m-p/2936705#M112795</link>
    <description>James,&lt;BR /&gt;&lt;BR /&gt;Yes, thanks.  Did modify your example for my needs.  In fact, wanted the contents of the log sent to me, so here is what I did --&lt;BR /&gt;&lt;BR /&gt;find / \( -name 'myLog.out' -a -size +0c \) |[ `wc -c` != 0 ] &amp;amp;&amp;amp; mail user@domain &amp;lt; myLog.out&lt;BR /&gt;&lt;BR /&gt;For extra points, how to set find statement to a variable and then reuse variable for redirecting to mail?</description>
    <pubDate>Thu, 27 Mar 2003 00:17:33 GMT</pubDate>
    <dc:creator>Anna Fong</dc:creator>
    <dc:date>2003-03-27T00:17:33Z</dc:date>
    <item>
      <title>conditional mail on find?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/conditional-mail-on-find/m-p/2936700#M112790</link>
      <description>I want to send myself an email only if find cmd locates a file over a certain size.&lt;BR /&gt;&lt;BR /&gt;I tried this but it always sends a message, which isn't what I want.  &lt;BR /&gt;&lt;BR /&gt;find / \( -name myLog.out' \) -size +1c -exec cat {} \; | mail user@domain     &lt;BR /&gt;&lt;BR /&gt;Is what I'm attempting even possible without having to create a script?</description>
      <pubDate>Wed, 26 Mar 2003 22:05:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/conditional-mail-on-find/m-p/2936700#M112790</guid>
      <dc:creator>Anna Fong</dc:creator>
      <dc:date>2003-03-26T22:05:10Z</dc:date>
    </item>
    <item>
      <title>Re: conditional mail on find?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/conditional-mail-on-find/m-p/2936701#M112791</link>
      <description>Hi Anna:&lt;BR /&gt;&lt;BR /&gt;Well, I suppose anything that fits on a command line isn't a script (or is it?) :-))&lt;BR /&gt;&lt;BR /&gt;Try this:&lt;BR /&gt;&lt;BR /&gt;# find /tmp \( -name 'myLog.out' -a -size +0c \) |[ `wc -c` != 0 ] &amp;amp;&amp;amp; mailx -s "BigFile" root &amp;lt; /dev/null&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Wed, 26 Mar 2003 22:30:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/conditional-mail-on-find/m-p/2936701#M112791</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2003-03-26T22:30:30Z</dc:date>
    </item>
    <item>
      <title>Re: conditional mail on find?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/conditional-mail-on-find/m-p/2936702#M112792</link>
      <description>find / -name myLog.log -size +&lt;WHATEVER bytes=""&gt;c -exec cat {} \; |mailx -s "File is too big" user@domain&lt;/WHATEVER&gt;</description>
      <pubDate>Wed, 26 Mar 2003 22:46:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/conditional-mail-on-find/m-p/2936702#M112792</guid>
      <dc:creator>Wilfred Chau_1</dc:creator>
      <dc:date>2003-03-26T22:46:01Z</dc:date>
    </item>
    <item>
      <title>Re: conditional mail on find?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/conditional-mail-on-find/m-p/2936703#M112793</link>
      <description>Hi (again) Anna:&lt;BR /&gt;&lt;BR /&gt;You will need to change my example to fit your needs (of course).  That is, I offered a working "script" that probes the /tmp directory for a file named "myLog.out" with a size of zero bytes -- quite convenient for testing the logic...&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Wed, 26 Mar 2003 22:55:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/conditional-mail-on-find/m-p/2936703#M112793</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2003-03-26T22:55:00Z</dc:date>
    </item>
    <item>
      <title>Re: conditional mail on find?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/conditional-mail-on-find/m-p/2936704#M112794</link>
      <description>Wilfred,&lt;BR /&gt;&lt;BR /&gt;Your example does the same as mine -- always sending a file.  I want the mail to be conditional.  Nice try.</description>
      <pubDate>Thu, 27 Mar 2003 00:13:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/conditional-mail-on-find/m-p/2936704#M112794</guid>
      <dc:creator>Anna Fong</dc:creator>
      <dc:date>2003-03-27T00:13:20Z</dc:date>
    </item>
    <item>
      <title>Re: conditional mail on find?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/conditional-mail-on-find/m-p/2936705#M112795</link>
      <description>James,&lt;BR /&gt;&lt;BR /&gt;Yes, thanks.  Did modify your example for my needs.  In fact, wanted the contents of the log sent to me, so here is what I did --&lt;BR /&gt;&lt;BR /&gt;find / \( -name 'myLog.out' -a -size +0c \) |[ `wc -c` != 0 ] &amp;amp;&amp;amp; mail user@domain &amp;lt; myLog.out&lt;BR /&gt;&lt;BR /&gt;For extra points, how to set find statement to a variable and then reuse variable for redirecting to mail?</description>
      <pubDate>Thu, 27 Mar 2003 00:17:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/conditional-mail-on-find/m-p/2936705#M112795</guid>
      <dc:creator>Anna Fong</dc:creator>
      <dc:date>2003-03-27T00:17:33Z</dc:date>
    </item>
    <item>
      <title>Re: conditional mail on find?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/conditional-mail-on-find/m-p/2936706#M112796</link>
      <description>Hi Anna:&lt;BR /&gt;&lt;BR /&gt;By example, consider this:&lt;BR /&gt;&lt;BR /&gt;# DIR=/tmp&lt;BR /&gt;# NAME=myLog.out&lt;BR /&gt;# SIZE=500&lt;BR /&gt;# find ${DIR} \( -name ${NAME} -a -size +${SIZE}c \)&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 27 Mar 2003 01:17:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/conditional-mail-on-find/m-p/2936706#M112796</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2003-03-27T01:17:05Z</dc:date>
    </item>
    <item>
      <title>Re: conditional mail on find?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/conditional-mail-on-find/m-p/2936707#M112797</link>
      <description>hi,&lt;BR /&gt;&lt;BR /&gt;i usually do it this way:&lt;BR /&gt;#=============================&lt;BR /&gt;#!/bin/sh&lt;BR /&gt;emailadd1=yogeeraj@mymailserver.mu&lt;BR /&gt;DIR=/tmp &lt;BR /&gt;NAME=105.sh &lt;BR /&gt;SIZE=5 &lt;BR /&gt;m=`find ${DIR} \( -name ${NAME} -a -size +${SIZE}c \)`&lt;BR /&gt;&lt;BR /&gt;/usr/bin/uuencode $m "logfile_needed.log"|mailx -m -s "The is the file you need - `date`" $emailadd1&lt;BR /&gt;&lt;BR /&gt;#=============================&lt;BR /&gt;&lt;BR /&gt;Hope this helps!&lt;BR /&gt;Yogeeraj</description>
      <pubDate>Thu, 27 Mar 2003 04:55:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/conditional-mail-on-find/m-p/2936707#M112797</guid>
      <dc:creator>Yogeeraj_1</dc:creator>
      <dc:date>2003-03-27T04:55:36Z</dc:date>
    </item>
    <item>
      <title>Re: conditional mail on find?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/conditional-mail-on-find/m-p/2936708#M112798</link>
      <description>James,&lt;BR /&gt;&lt;BR /&gt;Thanks again for the example.  This is what I ended up with (all on one line)   -- &lt;BR /&gt;&lt;BR /&gt;# FPATH=/path/to; FNAME=myLog.out; find ${FPATH} \( -name ${FNAME} -a -size +0c \) |[ `wc -c` != 0 ] &amp;amp;&amp;amp; &amp;gt; mail user@domain &amp;lt; "${FPATH}/${FNAME}"&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 27 Mar 2003 22:27:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/conditional-mail-on-find/m-p/2936708#M112798</guid>
      <dc:creator>Anna Fong</dc:creator>
      <dc:date>2003-03-27T22:27:40Z</dc:date>
    </item>
    <item>
      <title>Re: conditional mail on find?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/conditional-mail-on-find/m-p/2936709#M112799</link>
      <description>Yogeeraj,&lt;BR /&gt;&lt;BR /&gt;Thanks for your example.  Didn't try it out because I ended up doing this -- &lt;BR /&gt;&lt;BR /&gt;# FPATH=/path/to; FNAME=myLog.out; find ${FPATH} \( -name ${FNAME} -a -size +0c \) |[ `wc -c` != 0 ] &amp;amp;&amp;amp; &amp;gt; mail user@domain &amp;lt; "${FPATH}/${FNAME}"</description>
      <pubDate>Thu, 27 Mar 2003 22:30:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/conditional-mail-on-find/m-p/2936709#M112799</guid>
      <dc:creator>Anna Fong</dc:creator>
      <dc:date>2003-03-27T22:30:31Z</dc:date>
    </item>
  </channel>
</rss>

