<?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 how to suppress an error in a mail command in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/how-to-suppress-an-error-in-a-mail-command/m-p/4768862#M43991</link>
    <description>I have written something like this to send me filesystem status every 2 hours. i run this as a cron.&lt;BR /&gt;&lt;BR /&gt;[script]&lt;BR /&gt;df -h &amp;gt; /home/ap/fsstatus.txt&lt;BR /&gt;uptime &amp;gt;&amp;gt; /home/ap/fsstatus.txt&lt;BR /&gt;mail -s "haad-oas1 File System Status" ap@gmail.com &amp;lt; /home/ap/fsstatus.txt&lt;BR /&gt;[/script]&lt;BR /&gt;&lt;BR /&gt;when this mail goes through exchange it throws an exception bounce back email with the following text&lt;BR /&gt;[bounceback mail contents]&lt;BR /&gt;tar: Removing leading `/' from member names&lt;BR /&gt;/var/log/messages&lt;BR /&gt;[/bounceback mail contents]&lt;BR /&gt;&lt;BR /&gt;how can i avoid this.&lt;BR /&gt;&lt;BR /&gt;thanks</description>
    <pubDate>Wed, 23 Mar 2011 08:17:39 GMT</pubDate>
    <dc:creator>iinfi1</dc:creator>
    <dc:date>2011-03-23T08:17:39Z</dc:date>
    <item>
      <title>how to suppress an error in a mail command</title>
      <link>https://community.hpe.com/t5/operating-system-linux/how-to-suppress-an-error-in-a-mail-command/m-p/4768862#M43991</link>
      <description>I have written something like this to send me filesystem status every 2 hours. i run this as a cron.&lt;BR /&gt;&lt;BR /&gt;[script]&lt;BR /&gt;df -h &amp;gt; /home/ap/fsstatus.txt&lt;BR /&gt;uptime &amp;gt;&amp;gt; /home/ap/fsstatus.txt&lt;BR /&gt;mail -s "haad-oas1 File System Status" ap@gmail.com &amp;lt; /home/ap/fsstatus.txt&lt;BR /&gt;[/script]&lt;BR /&gt;&lt;BR /&gt;when this mail goes through exchange it throws an exception bounce back email with the following text&lt;BR /&gt;[bounceback mail contents]&lt;BR /&gt;tar: Removing leading `/' from member names&lt;BR /&gt;/var/log/messages&lt;BR /&gt;[/bounceback mail contents]&lt;BR /&gt;&lt;BR /&gt;how can i avoid this.&lt;BR /&gt;&lt;BR /&gt;thanks</description>
      <pubDate>Wed, 23 Mar 2011 08:17:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/how-to-suppress-an-error-in-a-mail-command/m-p/4768862#M43991</guid>
      <dc:creator>iinfi1</dc:creator>
      <dc:date>2011-03-23T08:17:39Z</dc:date>
    </item>
    <item>
      <title>Re: how to suppress an error in a mail command</title>
      <link>https://community.hpe.com/t5/operating-system-linux/how-to-suppress-an-error-in-a-mail-command/m-p/4768863#M43992</link>
      <description>You've redirected the standard output (stdout) of your commands to file fsstatus.txt, but the standard error output (stderr) is not redirected.&lt;BR /&gt;&lt;BR /&gt;The messages you're seeing are sent to stderr by the tar command.&lt;BR /&gt;&lt;BR /&gt;The syntax to redirect stderr to a file is "2&amp;gt; somefile" or "2&amp;gt;&amp;gt; somefile", similar to "&amp;gt;" and "&amp;gt;&amp;gt;" used for redirecting stdout. There is also a shorthand "2&amp;gt;&amp;amp;1" which means "send the stderr output to the same place where the stdout is going." The numbers refer to standard file descriptor numbers: stdin is #0, stdout is #1 and stderr is #2.&lt;BR /&gt;&lt;BR /&gt;So you might modify your script like this:&lt;BR /&gt;--------&lt;BR /&gt;df -h &amp;gt; /home/ap/fsstatus.txt 2&amp;gt;&amp;amp;1&lt;BR /&gt;uptime &amp;gt;&amp;gt; /home/ap/fsstatus.txt 2&amp;gt;&amp;amp;1&lt;BR /&gt;mail -s "haad-oas1 File System Status" ap@gmail.com &amp;lt; /home/ap/fsstatus.txt&lt;BR /&gt;--------&lt;BR /&gt;&lt;BR /&gt;MK</description>
      <pubDate>Wed, 23 Mar 2011 09:13:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/how-to-suppress-an-error-in-a-mail-command/m-p/4768863#M43992</guid>
      <dc:creator>Matti_Kurkela</dc:creator>
      <dc:date>2011-03-23T09:13:57Z</dc:date>
    </item>
    <item>
      <title>Re: how to suppress an error in a mail command</title>
      <link>https://community.hpe.com/t5/operating-system-linux/how-to-suppress-an-error-in-a-mail-command/m-p/4768864#M43993</link>
      <description>oh... ok&lt;BR /&gt;&lt;BR /&gt;i forget the basics too often for comfort.&lt;BR /&gt;and further the tar error is being thrown by another script.&lt;BR /&gt;&lt;BR /&gt;thank you Matti</description>
      <pubDate>Wed, 23 Mar 2011 09:18:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/how-to-suppress-an-error-in-a-mail-command/m-p/4768864#M43993</guid>
      <dc:creator>iinfi1</dc:creator>
      <dc:date>2011-03-23T09:18:06Z</dc:date>
    </item>
    <item>
      <title>Re: how to suppress an error in a mail command</title>
      <link>https://community.hpe.com/t5/operating-system-linux/how-to-suppress-an-error-in-a-mail-command/m-p/4768865#M43994</link>
      <description>&lt;!--!*#--&gt;&amp;gt; and further the tar error is being thrown&lt;BR /&gt;&amp;gt; by another script.&lt;BR /&gt;&lt;BR /&gt;Probably one with a "tar" command in it.&lt;BR /&gt;("tar: &lt;MESSAGE&gt;" was a clue.)&lt;BR /&gt;&lt;BR /&gt;And you could avoid this complaint by&lt;BR /&gt;specifying a relative path ("fred") instead&lt;BR /&gt;of an absolute path ("/fred") there, which is&lt;BR /&gt;generally considered a better practice for&lt;BR /&gt;various reasons (which is why "tar" is trying&lt;BR /&gt;to "help" you this way).&lt;BR /&gt;&lt;BR /&gt;      man tar&lt;/MESSAGE&gt;</description>
      <pubDate>Wed, 23 Mar 2011 11:24:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/how-to-suppress-an-error-in-a-mail-command/m-p/4768865#M43994</guid>
      <dc:creator>Steven Schweda</dc:creator>
      <dc:date>2011-03-23T11:24:21Z</dc:date>
    </item>
  </channel>
</rss>

