<?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: cron in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/cron/m-p/2992515#M124665</link>
    <description>Thanks for all.Replies were very useful.&lt;BR /&gt;Thanks</description>
    <pubDate>Tue, 10 Jun 2003 20:18:16 GMT</pubDate>
    <dc:creator>navin</dc:creator>
    <dc:date>2003-06-10T20:18:16Z</dc:date>
    <item>
      <title>cron</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cron/m-p/2992507#M124657</link>
      <description>I have created a cron entry ,i would like to get the output in e-mail.please help.&lt;BR /&gt;Thanks</description>
      <pubDate>Mon, 09 Jun 2003 16:13:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cron/m-p/2992507#M124657</guid>
      <dc:creator>navin</dc:creator>
      <dc:date>2003-06-09T16:13:22Z</dc:date>
    </item>
    <item>
      <title>Re: cron</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cron/m-p/2992508#M124658</link>
      <description>* * * * * command you are running |mailx your.address@yoursite.com</description>
      <pubDate>Mon, 09 Jun 2003 16:21:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cron/m-p/2992508#M124658</guid>
      <dc:creator>Ken Penland_1</dc:creator>
      <dc:date>2003-06-09T16:21:20Z</dc:date>
    </item>
    <item>
      <title>Re: cron</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cron/m-p/2992509#M124659</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;One approach is to create a wrapper script that will capture the log and send it to the user. It may look like&lt;BR /&gt;&lt;BR /&gt;script_wrapper&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/ksh&lt;BR /&gt;USER=yourid@youruser.com&lt;BR /&gt;LOG=/tmp/log$$&lt;BR /&gt;/your_path/your_script &amp;gt; $LOG 2&amp;gt;&amp;amp;1&lt;BR /&gt;mailx -s "Out put of your_script" $USER &amp;lt; $LOG&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Put the above script into the cron.&lt;BR /&gt;&lt;BR /&gt;One more approach is to put the mailx directly into the cront&lt;BR /&gt;&lt;BR /&gt;* * * * * /your_path/Your_script |mailx -s "cronout" yourid@youruser.com&lt;BR /&gt;&lt;BR /&gt;I would actually create an alias for your user in the system so that all the mails to your account will come to you.&lt;BR /&gt;&lt;BR /&gt;Edit /etc/mail/aliases and point user to yourid@yourhost.com. &lt;BR /&gt;&lt;BR /&gt;-Sri</description>
      <pubDate>Mon, 09 Jun 2003 16:27:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cron/m-p/2992509#M124659</guid>
      <dc:creator>Sridhar Bhaskarla</dc:creator>
      <dc:date>2003-06-09T16:27:06Z</dc:date>
    </item>
    <item>
      <title>Re: cron</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cron/m-p/2992510#M124660</link>
      <description>cron will e-mail any standard output and standard error generated by the cron job to the user id that owns that crontab.&lt;BR /&gt;&lt;BR /&gt;If you want to send it to a different e-mail address, then redirect your stdout (and std err) to a mail command, like so:&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;/path/to/command &amp;gt; /usr/bin/mailx -s "Cron Output" user@somewhere.com  2&amp;gt;$1&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 09 Jun 2003 16:29:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cron/m-p/2992510#M124660</guid>
      <dc:creator>Bill Douglass</dc:creator>
      <dc:date>2003-06-09T16:29:02Z</dc:date>
    </item>
    <item>
      <title>Re: cron</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cron/m-p/2992511#M124661</link>
      <description>Sorry, that should be &lt;BR /&gt;&lt;BR /&gt;/path/to/command | /usr/bin/mailx -s "Cron Output" user@somewhere.com 2&amp;gt;$1&lt;BR /&gt;&lt;BR /&gt;Need a pipe there.</description>
      <pubDate>Mon, 09 Jun 2003 16:30:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cron/m-p/2992511#M124661</guid>
      <dc:creator>Bill Douglass</dc:creator>
      <dc:date>2003-06-09T16:30:25Z</dc:date>
    </item>
    <item>
      <title>Re: cron</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cron/m-p/2992512#M124662</link>
      <description>Hi,&lt;BR /&gt;from man crontab:&lt;BR /&gt;....&lt;BR /&gt;Be sure to redirect the standard output and standard error from commands.  If this is not done, any generated standard output or standard error is mailed to the user.&lt;BR /&gt;......&lt;BR /&gt;&lt;BR /&gt;In linux, before any crontab entries you must put a line with the variable:&lt;BR /&gt;MAILTO=user&lt;BR /&gt;&lt;BR /&gt;Frank.</description>
      <pubDate>Mon, 09 Jun 2003 16:33:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cron/m-p/2992512#M124662</guid>
      <dc:creator>Francisco J. Soler</dc:creator>
      <dc:date>2003-06-09T16:33:30Z</dc:date>
    </item>
    <item>
      <title>Re: cron</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cron/m-p/2992513#M124663</link>
      <description>Hi!&lt;BR /&gt;&lt;BR /&gt;Edit your crontab using crontab -e or sam and add the following to the crontab line:&lt;BR /&gt;&lt;BR /&gt;| mailx -s "Subject you want" user@domain.com 2&amp;gt;$1&lt;BR /&gt;&lt;BR /&gt;Note that I am starting this with a pipe.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;DR</description>
      <pubDate>Mon, 09 Jun 2003 17:07:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cron/m-p/2992513#M124663</guid>
      <dc:creator>Dario_1</dc:creator>
      <dc:date>2003-06-09T17:07:37Z</dc:date>
    </item>
    <item>
      <title>Re: cron</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cron/m-p/2992514#M124664</link>
      <description>Hi!&lt;BR /&gt;&lt;BR /&gt;Edit your crontab using crontab -e or sam and add the following to the crontab line:&lt;BR /&gt;&lt;BR /&gt;| mailx -s "Subject you want" user@domain.com 2&amp;gt;$1&lt;BR /&gt;&lt;BR /&gt;Note that I am starting this with a pipe.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;DR</description>
      <pubDate>Mon, 09 Jun 2003 17:08:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cron/m-p/2992514#M124664</guid>
      <dc:creator>Dario_1</dc:creator>
      <dc:date>2003-06-09T17:08:17Z</dc:date>
    </item>
    <item>
      <title>Re: cron</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cron/m-p/2992515#M124665</link>
      <description>Thanks for all.Replies were very useful.&lt;BR /&gt;Thanks</description>
      <pubDate>Tue, 10 Jun 2003 20:18:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cron/m-p/2992515#M124665</guid>
      <dc:creator>navin</dc:creator>
      <dc:date>2003-06-10T20:18:16Z</dc:date>
    </item>
    <item>
      <title>Re: cron</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cron/m-p/2992516#M124666</link>
      <description>From what I can tell here, most everyone that is pipeing the script output to mailx has their stderror to stdout redirect in the wrong place.&lt;BR /&gt;&lt;BR /&gt;What I am seeing:&lt;BR /&gt;&lt;BR /&gt;script | mailx -s "subject" mail@junk.com 2&amp;gt;&amp;amp;1 &lt;BR /&gt;&lt;BR /&gt;will not work like you think.  That will only redirect standard error to standard out for the mailx command, NOT the script.&lt;BR /&gt;&lt;BR /&gt;What you really probably want is:&lt;BR /&gt;&lt;BR /&gt;script 2&amp;gt;&amp;amp;1 | mailx -s "subject" mail@junk.com&lt;BR /&gt;&lt;BR /&gt;The above will redirect the standard error to standard out for the script that is run and THEN pipe that output into the mailx command.  This way you get any output and errors from your script mailed to you.</description>
      <pubDate>Tue, 10 Jun 2003 20:26:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cron/m-p/2992516#M124666</guid>
      <dc:creator>Patrick Wallek</dc:creator>
      <dc:date>2003-06-10T20:26:17Z</dc:date>
    </item>
  </channel>
</rss>

