<?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: cronjob in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/cronjob/m-p/4867657#M860769</link>
    <description>Hi,&lt;BR /&gt;regarding the error in line 20:&lt;BR /&gt;/ohio/bin/qc_aging.sh[20]: qc_aging_nlr.txt: Cannot find or open the file.&lt;BR /&gt;&lt;BR /&gt;does the script look for the file in the correct directory?&lt;BR /&gt;&lt;BR /&gt;regards,&lt;BR /&gt;John K. &lt;BR /&gt;</description>
    <pubDate>Wed, 27 Oct 2004 12:49:58 GMT</pubDate>
    <dc:creator>john korterman</dc:creator>
    <dc:date>2004-10-27T12:49:58Z</dc:date>
    <item>
      <title>cronjob</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cronjob/m-p/4867641#M860753</link>
      <description>This is my problem... I have job schedule to kick off on Mondays at 21:00 which generates reports and suppose to send a mail to users... The thing is the job works fine from the command line but if cron runs the job it generates the report but doesn't send the emails.. .any thoughts as to why this could be occuring?</description>
      <pubDate>Wed, 27 Oct 2004 09:42:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cronjob/m-p/4867641#M860753</guid>
      <dc:creator>Deoncia Grayson_1</dc:creator>
      <dc:date>2004-10-27T09:42:14Z</dc:date>
    </item>
    <item>
      <title>Re: cronjob</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cronjob/m-p/4867642#M860754</link>
      <description>Cron has no environment file.&lt;BR /&gt;&lt;BR /&gt;Any variable your script needs like:&lt;BR /&gt;PATH&lt;BR /&gt;TERM&lt;BR /&gt;&lt;BR /&gt;has to be set explicitly in the cron script.&lt;BR /&gt;&lt;BR /&gt;Sometimes you can include a user source file in the script&lt;BR /&gt;&lt;BR /&gt;. /home/username/.profile&lt;BR /&gt;&lt;BR /&gt;That might help.&lt;BR /&gt;&lt;BR /&gt;That is the most common cause of this issue.&lt;BR /&gt;&lt;BR /&gt;SEP</description>
      <pubDate>Wed, 27 Oct 2004 09:45:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cronjob/m-p/4867642#M860754</guid>
      <dc:creator>Steven E. Protter</dc:creator>
      <dc:date>2004-10-27T09:45:48Z</dc:date>
    </item>
    <item>
      <title>Re: cronjob</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cronjob/m-p/4867643#M860755</link>
      <description>Another thing - you can log your cron jobs like so for example:&lt;BR /&gt;&lt;BR /&gt;# logrotate&lt;BR /&gt;#&lt;BR /&gt;0 0 * * * /opt/logrotate/bin/logrotate /etc/logrotate.conf &amp;gt;/tmp/logrotate.cron 2&amp;gt;&amp;amp;1&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Any errors will be in /tmp/logrotate.cron &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Rgds...Geoff</description>
      <pubDate>Wed, 27 Oct 2004 09:48:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cronjob/m-p/4867643#M860755</guid>
      <dc:creator>Geoff Wild</dc:creator>
      <dc:date>2004-10-27T09:48:18Z</dc:date>
    </item>
    <item>
      <title>Re: cronjob</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cronjob/m-p/4867644#M860756</link>
      <description>The variables are set in the script. This is not a root cronjob but a users cronjob.   I will log the errors to try to capture what is happening because the logs in /var/adm/cron are not telling me anything useful, just that the job ran.</description>
      <pubDate>Wed, 27 Oct 2004 09:58:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cronjob/m-p/4867644#M860756</guid>
      <dc:creator>Deoncia Grayson_1</dc:creator>
      <dc:date>2004-10-27T09:58:32Z</dc:date>
    </item>
    <item>
      <title>Re: cronjob</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cronjob/m-p/4867645#M860757</link>
      <description>Okay - if the user's cron is executing a script, for more detail, add a &lt;BR /&gt;&lt;BR /&gt;set -x&lt;BR /&gt;&lt;BR /&gt;near the top of the script on its own line...(after #!/bin/sh or what have you)&lt;BR /&gt;&lt;BR /&gt;Rgds...Geoff</description>
      <pubDate>Wed, 27 Oct 2004 10:49:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cronjob/m-p/4867645#M860757</guid>
      <dc:creator>Geoff Wild</dc:creator>
      <dc:date>2004-10-27T10:49:57Z</dc:date>
    </item>
    <item>
      <title>Re: cronjob</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cronjob/m-p/4867646#M860758</link>
      <description>What mail agent are you using and what's the system load like at the time?  Sendmail will sometimes refuse connections if the system gets too busy.&lt;BR /&gt;&lt;BR /&gt;You can check your mail queue with mailq -v -d to see if there are rejects or mail sitting in the queue going nowhere.  You can force-flush the queue with sendmail -v -d8.20 -q&lt;BR /&gt;&lt;BR /&gt;Also, if you are using aliases to send the e-mail, check the permissions on /etc/mail to see if other has read permissions.&lt;BR /&gt;&lt;BR /&gt;mark</description>
      <pubDate>Wed, 27 Oct 2004 11:01:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cronjob/m-p/4867646#M860758</guid>
      <dc:creator>Mark Greene_1</dc:creator>
      <dc:date>2004-10-27T11:01:42Z</dc:date>
    </item>
    <item>
      <title>Re: cronjob</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cronjob/m-p/4867647#M860759</link>
      <description>sorry, that's /etc/mail/aliases and /etc/aliases (which is a link to the former).&lt;BR /&gt;&lt;BR /&gt;mark</description>
      <pubDate>Wed, 27 Oct 2004 11:02:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cronjob/m-p/4867647#M860759</guid>
      <dc:creator>Mark Greene_1</dc:creator>
      <dc:date>2004-10-27T11:02:26Z</dc:date>
    </item>
    <item>
      <title>Re: cronjob</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cronjob/m-p/4867648#M860760</link>
      <description>Hi,&lt;BR /&gt;if the cron log states that the job ran and actually ended without errors, the problem i s more likely in the mail system or in that direction.&lt;BR /&gt;However, try and check the mail of the user in question; it might give a clue.&lt;BR /&gt; &lt;BR /&gt;regards,&lt;BR /&gt;John K.&lt;BR /&gt;</description>
      <pubDate>Wed, 27 Oct 2004 11:03:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cronjob/m-p/4867648#M860760</guid>
      <dc:creator>john korterman</dc:creator>
      <dc:date>2004-10-27T11:03:58Z</dc:date>
    </item>
    <item>
      <title>Re: cronjob</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cronjob/m-p/4867649#M860761</link>
      <description>We're using elm to mail the files&lt;BR /&gt;&lt;BR /&gt;elm -s "QC Aging - NLR" $MAIL_SEND_TO_NLR &amp;lt; qc_aging_nlr.txt&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;This works fine when manually ran, but not inside the cronjob.</description>
      <pubDate>Wed, 27 Oct 2004 11:10:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cronjob/m-p/4867649#M860761</guid>
      <dc:creator>Deoncia Grayson_1</dc:creator>
      <dc:date>2004-10-27T11:10:10Z</dc:date>
    </item>
    <item>
      <title>Re: cronjob</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cronjob/m-p/4867650#M860762</link>
      <description>You can try with mailx:&lt;BR /&gt;&lt;BR /&gt;mailx -s "QC Aging - NLR" $MAIL_SEND_TO_NLR &amp;lt; qc_aging_nlr.txt&lt;BR /&gt;&lt;BR /&gt;But best to wait to see the /tmp/cronjob.log....&lt;BR /&gt;&lt;BR /&gt;Rgds...Geoff</description>
      <pubDate>Wed, 27 Oct 2004 11:31:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cronjob/m-p/4867650#M860762</guid>
      <dc:creator>Geoff Wild</dc:creator>
      <dc:date>2004-10-27T11:31:05Z</dc:date>
    </item>
    <item>
      <title>Re: cronjob</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cronjob/m-p/4867651#M860763</link>
      <description>Hi Deoncia,&lt;BR /&gt;&lt;BR /&gt;  You dont have to wait till next Monday to look at the output from the script :-).&lt;BR /&gt;&lt;BR /&gt;  By default, cron sends stdout and stderr to the user's UNIX mailbox, if there is no output redirection.&lt;BR /&gt;&lt;BR /&gt;  Refer the /var/mail/&lt;USERNAME&gt;. You should see the output from the script. Post the error message here. This can get you the answer for your problem.&lt;BR /&gt;&lt;BR /&gt;- Sundar.&lt;/USERNAME&gt;</description>
      <pubDate>Wed, 27 Oct 2004 11:54:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cronjob/m-p/4867651#M860763</guid>
      <dc:creator>Sundar_7</dc:creator>
      <dc:date>2004-10-27T11:54:29Z</dc:date>
    </item>
    <item>
      <title>Re: cronjob</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cronjob/m-p/4867652#M860764</link>
      <description>Sundar - that's true - unless the cron entry is like so:&lt;BR /&gt;&lt;BR /&gt;0 22 * * 4 /usr/local/bin/fsadm.defrag &amp;gt;/dev/null 2&amp;gt;&amp;amp;1&lt;BR /&gt;&lt;BR /&gt;In which case the errors are gone...&lt;BR /&gt;&lt;BR /&gt;Rgds...Geoff&lt;BR /&gt;</description>
      <pubDate>Wed, 27 Oct 2004 12:16:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cronjob/m-p/4867652#M860764</guid>
      <dc:creator>Geoff Wild</dc:creator>
      <dc:date>2004-10-27T12:16:22Z</dc:date>
    </item>
    <item>
      <title>Re: cronjob</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cronjob/m-p/4867653#M860765</link>
      <description>You are right Geoff. But I pressume Deoncia doesnt have it redirected.</description>
      <pubDate>Wed, 27 Oct 2004 12:27:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cronjob/m-p/4867653#M860765</guid>
      <dc:creator>Sundar_7</dc:creator>
      <dc:date>2004-10-27T12:27:00Z</dc:date>
    </item>
    <item>
      <title>Re: cronjob</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cronjob/m-p/4867654#M860766</link>
      <description>From root Tue Oct 26 21:00:03 CDT 2004&lt;BR /&gt;Received: (from root@localhost) by maydist2.maybelline.com (8.8.6 (PHNE_17190)/8&lt;BR /&gt;.7.1) id VAA03707 for ohio; Tue, 26 Oct 2004 21:00:03 -0500 (CDT)&lt;BR /&gt;Date: Tue, 26 Oct 2004 21:00:03 -0500 (CDT)&lt;BR /&gt;From: root&lt;BR /&gt;Message-Id: &amp;lt;200410270200.VAA03707@maydist2.maybelline.com&amp;gt;&lt;BR /&gt;Subject: cron&lt;BR /&gt;&lt;BR /&gt;/ohio/bin/qc_aging.sh[20]: qc_aging_nlr.txt: Cannot find or open the file.&lt;BR /&gt;logout&lt;BR /&gt;&lt;BR /&gt;This error that cron is mailing to the user, but the file does exist. &lt;BR /&gt;ls -lai qc_aging_nlr.txt&lt;BR /&gt;   169 -rwxrwxrwx   1 ohio       users          151 Oct 25 11:01 qc_aging_nlr.tx&lt;BR /&gt;t&lt;BR /&gt;</description>
      <pubDate>Wed, 27 Oct 2004 12:31:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cronjob/m-p/4867654#M860766</guid>
      <dc:creator>Deoncia Grayson_1</dc:creator>
      <dc:date>2004-10-27T12:31:23Z</dc:date>
    </item>
    <item>
      <title>Re: cronjob</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cronjob/m-p/4867655#M860767</link>
      <description>Yes - but I think  you need the absolute path in the script:&lt;BR /&gt;&lt;BR /&gt;Instead of:&lt;BR /&gt;&lt;BR /&gt;elm -s "QC Aging - NLR" $MAIL_SEND_TO_NLR &amp;lt; qc_aging_nlr.txt&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;try&lt;BR /&gt;&lt;BR /&gt;elm -s "QC Aging - NLR" $MAIL_SEND_TO_NLR &amp;lt; /the/path/to/qc_aging_nlr.txt&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Rgds...Geoff</description>
      <pubDate>Wed, 27 Oct 2004 12:35:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cronjob/m-p/4867655#M860767</guid>
      <dc:creator>Geoff Wild</dc:creator>
      <dc:date>2004-10-27T12:35:25Z</dc:date>
    </item>
    <item>
      <title>Re: cronjob</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cronjob/m-p/4867656#M860768</link>
      <description>Geoff has it. Use full path to the filename and not just the relative path name.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 27 Oct 2004 12:40:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cronjob/m-p/4867656#M860768</guid>
      <dc:creator>Sundar_7</dc:creator>
      <dc:date>2004-10-27T12:40:27Z</dc:date>
    </item>
    <item>
      <title>Re: cronjob</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cronjob/m-p/4867657#M860769</link>
      <description>Hi,&lt;BR /&gt;regarding the error in line 20:&lt;BR /&gt;/ohio/bin/qc_aging.sh[20]: qc_aging_nlr.txt: Cannot find or open the file.&lt;BR /&gt;&lt;BR /&gt;does the script look for the file in the correct directory?&lt;BR /&gt;&lt;BR /&gt;regards,&lt;BR /&gt;John K. &lt;BR /&gt;</description>
      <pubDate>Wed, 27 Oct 2004 12:49:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cronjob/m-p/4867657#M860769</guid>
      <dc:creator>john korterman</dc:creator>
      <dc:date>2004-10-27T12:49:58Z</dc:date>
    </item>
    <item>
      <title>Re: cronjob</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cronjob/m-p/4867658#M860770</link>
      <description>Thanks everyone for your time and contributions. The issue is resolved.  Big thanks to Geof and Sundar!</description>
      <pubDate>Wed, 27 Oct 2004 12:54:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cronjob/m-p/4867658#M860770</guid>
      <dc:creator>Deoncia Grayson_1</dc:creator>
      <dc:date>2004-10-27T12:54:55Z</dc:date>
    </item>
    <item>
      <title>Re: cronjob</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cronjob/m-p/4867659#M860771</link>
      <description>see final remarks again Thanks everyone</description>
      <pubDate>Wed, 27 Oct 2004 12:55:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cronjob/m-p/4867659#M860771</guid>
      <dc:creator>Deoncia Grayson_1</dc:creator>
      <dc:date>2004-10-27T12:55:41Z</dc:date>
    </item>
  </channel>
</rss>

