<?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: Scripted report via email in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/scripted-report-via-email/m-p/2546634#M875095</link>
    <description>Actually that should work but there must be a ${HOME}/.elm directory owned by the cron user in the cron user's home direcory.&lt;BR /&gt;&lt;BR /&gt;Clay&lt;BR /&gt;</description>
    <pubDate>Thu, 28 Jun 2001 20:51:30 GMT</pubDate>
    <dc:creator>A. Clay Stephenson</dc:creator>
    <dc:date>2001-06-28T20:51:30Z</dc:date>
    <item>
      <title>Scripted report via email</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripted-report-via-email/m-p/2546632#M875093</link>
      <description>I want to send a text file via email from a script. At present, this is what I do : &lt;BR /&gt;&lt;BR /&gt;cd /home/reports             &lt;BR /&gt;touch bdf.txt                       &lt;BR /&gt;date &amp;gt; bdf.txt                      &lt;BR /&gt;bdf &amp;gt;&amp;gt; bdf.txt                      &lt;BR /&gt;elm -s "bdf Report" root &amp;lt; bdf.txt  &lt;BR /&gt;rm bdf.txt &lt;BR /&gt;&lt;BR /&gt;This works fine until I try to run it via cron., as it  returns the status lines:&lt;BR /&gt;sending mail&lt;BR /&gt;mail sent!&lt;BR /&gt;&lt;BR /&gt;When it does this, cron doesn't like it and generates an error.&lt;BR /&gt;&lt;BR /&gt;So... how do I get around this? Is there a script command to read the responses or is there a better way?&lt;BR /&gt; &lt;BR /&gt;Many Thanks,&lt;BR /&gt;Doug                         &lt;BR /&gt;</description>
      <pubDate>Thu, 28 Jun 2001 20:25:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripted-report-via-email/m-p/2546632#M875093</guid>
      <dc:creator>Doug Wheeler_1</dc:creator>
      <dc:date>2001-06-28T20:25:36Z</dc:date>
    </item>
    <item>
      <title>Re: Scripted report via email</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripted-report-via-email/m-p/2546633#M875094</link>
      <description>Hi Doug:&lt;BR /&gt;&lt;BR /&gt;'elm' is by design, interactive.  'cron' doesn't "like" interactive scripts!  Try this, instead:&lt;BR /&gt;&lt;BR /&gt;# mailx -s "bdf Report" root &amp;lt; bdf.txt&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Thu, 28 Jun 2001 20:41:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripted-report-via-email/m-p/2546633#M875094</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2001-06-28T20:41:27Z</dc:date>
    </item>
    <item>
      <title>Re: Scripted report via email</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripted-report-via-email/m-p/2546634#M875095</link>
      <description>Actually that should work but there must be a ${HOME}/.elm directory owned by the cron user in the cron user's home direcory.&lt;BR /&gt;&lt;BR /&gt;Clay&lt;BR /&gt;</description>
      <pubDate>Thu, 28 Jun 2001 20:51:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripted-report-via-email/m-p/2546634#M875095</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2001-06-28T20:51:30Z</dc:date>
    </item>
    <item>
      <title>Re: Scripted report via email</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripted-report-via-email/m-p/2546635#M875096</link>
      <description>You also should have a Mail directory in the cron users home directory.</description>
      <pubDate>Thu, 28 Jun 2001 20:55:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripted-report-via-email/m-p/2546635#M875096</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2001-06-28T20:55:09Z</dc:date>
    </item>
    <item>
      <title>Re: Scripted report via email</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripted-report-via-email/m-p/2546636#M875097</link>
      <description>Doug,&lt;BR /&gt;&lt;BR /&gt;I have a script that does a bdf and some other things that I like to keep track of on a daily basic.  Below is the script and my cron entry.&lt;BR /&gt;=====&lt;BR /&gt;dailyfile=/home/root/dailychanges&lt;BR /&gt;echo "Daily Changes / `uname -n` / `date`" &amp;gt; $dailyfile&lt;BR /&gt;echo "" &amp;gt;&amp;gt; $dailyfile&lt;BR /&gt;echo "BDF" &amp;gt;&amp;gt; $dailyfile &lt;BR /&gt;bdf |grep vg00|awk '{print $5 " " $6}' &amp;gt;&amp;gt; $dailyfile&lt;BR /&gt;echo "" &amp;gt;&amp;gt; $dailyfile&lt;BR /&gt;echo "" &amp;gt;&amp;gt; $dailyfile&lt;BR /&gt;netstat -rn &amp;gt;&amp;gt; $dailyfile&lt;BR /&gt;echo "" &amp;gt;&amp;gt; $dailyfile&lt;BR /&gt;echo "" &amp;gt;&amp;gt; $dailyfile&lt;BR /&gt;echo "Netconf" &amp;gt;&amp;gt; $dailyfile&lt;BR /&gt;cat /etc/rc.config.d/netconf |grep -i IP_ADDRESS |grep -v '#' &amp;gt;&amp;gt; $dailyfile&lt;BR /&gt;cat /etc/rc.config.d/netconf |grep -i INTERFACE_NAME |grep -v '#' &amp;gt;&amp;gt; $dailyfile&lt;BR /&gt;echo "" &amp;gt;&amp;gt; $dailyfile&lt;BR /&gt;echo "" &amp;gt;&amp;gt; $dailyfile&lt;BR /&gt;echo "Uptime" &amp;gt;&amp;gt; $dailyfile&lt;BR /&gt;uptime &amp;gt;&amp;gt; $dailyfile&lt;BR /&gt;cat $dailyfile | mailx -s "Daily Changes Report for `uname -n`" YOU@YOURDOMAIN.com&lt;BR /&gt;=====&lt;BR /&gt;&lt;BR /&gt;Here is my entry in cron.&lt;BR /&gt;=====&lt;BR /&gt;# script checks for daily changes&lt;BR /&gt;0 20 * * * sh /home/root/daily_changes.sh&lt;BR /&gt;=====&lt;BR /&gt;&lt;BR /&gt;-Jason</description>
      <pubDate>Thu, 28 Jun 2001 21:17:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripted-report-via-email/m-p/2546636#M875097</guid>
      <dc:creator>Jason Morgan_1</dc:creator>
      <dc:date>2001-06-28T21:17:43Z</dc:date>
    </item>
    <item>
      <title>Re: Scripted report via email</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripted-report-via-email/m-p/2546637#M875098</link>
      <description>Thanks all for your help. I have tested and implemented the &lt;BR /&gt;'mailx -s "bdf Report" root &amp;lt; bdf.txt '&lt;BR /&gt;command as suggested by James.&lt;BR /&gt;Also thanks to Clay &amp;amp; Jason for your help as well.&lt;BR /&gt;Doug&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 29 Jun 2001 12:28:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripted-report-via-email/m-p/2546637#M875098</guid>
      <dc:creator>Doug Wheeler_1</dc:creator>
      <dc:date>2001-06-29T12:28:27Z</dc:date>
    </item>
    <item>
      <title>Re: Scripted report via email</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripted-report-via-email/m-p/2546638#M875099</link>
      <description>Hi Doug (again):&lt;BR /&gt;&lt;BR /&gt;OK, a better answer to your question:&lt;BR /&gt;&lt;BR /&gt;I assume that you are being bothered by the additional mailing (by cron) announcing "Cron: The previous message is the standard output&lt;BR /&gt;and standard error of one of your crontab commands" when you use 'elm'.&lt;BR /&gt;&lt;BR /&gt;You can circumvent this in one of several ways:&lt;BR /&gt;&lt;BR /&gt;1.  Use 'mailx' as I first suggested, since it doesn't write "mail sent!" and cause 'cron' to "complain".&lt;BR /&gt;&lt;BR /&gt;2.  Use 'elm' exactly as you have been doing, but construct your cron entry along this line:&lt;BR /&gt;&lt;BR /&gt;# * * * * * /thescript &amp;gt; dev/null 2&amp;gt;&amp;amp;1&lt;BR /&gt;&lt;BR /&gt;or, make your script's statement like this:&lt;BR /&gt;&lt;BR /&gt;# elm -s "bdf Report" root &amp;lt; bdf.txt &amp;gt; /dev/null 2&amp;gt;&amp;amp;1&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Fri, 29 Jun 2001 12:30:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripted-report-via-email/m-p/2546638#M875099</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2001-06-29T12:30:13Z</dc:date>
    </item>
  </channel>
</rss>

