<?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: script with symcli command not work in cron in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/script-with-symcli-command-not-work-in-cron/m-p/3131991#M799658</link>
    <description>Besides adding 'export VARIABLE' as suggested by Con, you could also use an output log and add 'set -xv' to the script, to see exactly what it is doing. Remember cron is really stupid and does not like utilising any type of environment variables, so therefore all of them must be in the script.</description>
    <pubDate>Sun, 30 Nov 2003 19:17:36 GMT</pubDate>
    <dc:creator>Michael Tully</dc:creator>
    <dc:date>2003-11-30T19:17:36Z</dc:date>
    <item>
      <title>script with symcli command not work in cron</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-with-symcli-command-not-work-in-cron/m-p/3131985#M799652</link>
      <description>Hi there,&lt;BR /&gt;&lt;BR /&gt;I have a script with the following lines:&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/ksh&lt;BR /&gt;SYMCLI_DB_FILE=/var/symapi/db/symapi_db.bin&lt;BR /&gt;/usr/symcli/bin/symmir -g bcv1 query &amp;gt; /tmp/bcv_list&lt;BR /&gt;&lt;BR /&gt;The script works find if I submit in Unix promot, but it didn't work if I put the script in the cron.  Any idea.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;&lt;BR /&gt;Simon&lt;BR /&gt;</description>
      <pubDate>Sun, 30 Nov 2003 18:44:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-with-symcli-command-not-work-in-cron/m-p/3131985#M799652</guid>
      <dc:creator>Camel_1</dc:creator>
      <dc:date>2003-11-30T18:44:05Z</dc:date>
    </item>
    <item>
      <title>Re: script with symcli command not work in cron</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-with-symcli-command-not-work-in-cron/m-p/3131986#M799653</link>
      <description>What is the exact entry your using in cron?&lt;BR /&gt;What are the permissions/ownership on the script?</description>
      <pubDate>Sun, 30 Nov 2003 18:48:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-with-symcli-command-not-work-in-cron/m-p/3131986#M799653</guid>
      <dc:creator>Michael Tully</dc:creator>
      <dc:date>2003-11-30T18:48:36Z</dc:date>
    </item>
    <item>
      <title>Re: script with symcli command not work in cron</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-with-symcli-command-not-work-in-cron/m-p/3131987#M799654</link>
      <description>I put in the full path of the script, the script is owned by root:sys and has "rx-" permission to owner, group.</description>
      <pubDate>Sun, 30 Nov 2003 18:56:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-with-symcli-command-not-work-in-cron/m-p/3131987#M799654</guid>
      <dc:creator>Camel_1</dc:creator>
      <dc:date>2003-11-30T18:56:26Z</dc:date>
    </item>
    <item>
      <title>Re: script with symcli command not work in cron</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-with-symcli-command-not-work-in-cron/m-p/3131988#M799655</link>
      <description>Hi Simon&lt;BR /&gt;&lt;BR /&gt;Presumably you're running the script from root's cron?&lt;BR /&gt;&lt;BR /&gt;Also check /var/adm/cron/log.&lt;BR /&gt;Is the cron job listed there?  It should show a rc??&lt;BR /&gt;&lt;BR /&gt;Cheers&lt;BR /&gt;Con&lt;BR /&gt;</description>
      <pubDate>Sun, 30 Nov 2003 19:02:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-with-symcli-command-not-work-in-cron/m-p/3131988#M799655</guid>
      <dc:creator>Con O'Kelly</dc:creator>
      <dc:date>2003-11-30T19:02:34Z</dc:date>
    </item>
    <item>
      <title>Re: script with symcli command not work in cron</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-with-symcli-command-not-work-in-cron/m-p/3131989#M799656</link>
      <description>the cron daemon is running, I can see the script was execute from cron log.  The output file didn't generate, but when I run the script in Unix promph it works fine.</description>
      <pubDate>Sun, 30 Nov 2003 19:04:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-with-symcli-command-not-work-in-cron/m-p/3131989#M799656</guid>
      <dc:creator>Camel_1</dc:creator>
      <dc:date>2003-11-30T19:04:46Z</dc:date>
    </item>
    <item>
      <title>Re: script with symcli command not work in cron</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-with-symcli-command-not-work-in-cron/m-p/3131990#M799657</link>
      <description>Try exporting the SYMCLI_DB_FILE variable in your script.&lt;BR /&gt;(ie export SYMCLI_DB_FILE)&lt;BR /&gt;I've had problems with cron in the past when I didn't export the variable.&lt;BR /&gt;&lt;BR /&gt;Cheers&lt;BR /&gt;Con</description>
      <pubDate>Sun, 30 Nov 2003 19:09:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-with-symcli-command-not-work-in-cron/m-p/3131990#M799657</guid>
      <dc:creator>Con O'Kelly</dc:creator>
      <dc:date>2003-11-30T19:09:26Z</dc:date>
    </item>
    <item>
      <title>Re: script with symcli command not work in cron</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-with-symcli-command-not-work-in-cron/m-p/3131991#M799658</link>
      <description>Besides adding 'export VARIABLE' as suggested by Con, you could also use an output log and add 'set -xv' to the script, to see exactly what it is doing. Remember cron is really stupid and does not like utilising any type of environment variables, so therefore all of them must be in the script.</description>
      <pubDate>Sun, 30 Nov 2003 19:17:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-with-symcli-command-not-work-in-cron/m-p/3131991#M799658</guid>
      <dc:creator>Michael Tully</dc:creator>
      <dc:date>2003-11-30T19:17:36Z</dc:date>
    </item>
    <item>
      <title>Re: script with symcli command not work in cron</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-with-symcli-command-not-work-in-cron/m-p/3131992#M799659</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;To debug the script problem, I always append output from every step of the script to a full path logfile, which permission could be 777. &lt;BR /&gt;Good luck.&lt;BR /&gt;twang</description>
      <pubDate>Mon, 01 Dec 2003 02:15:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-with-symcli-command-not-work-in-cron/m-p/3131992#M799659</guid>
      <dc:creator>twang</dc:creator>
      <dc:date>2003-12-01T02:15:48Z</dc:date>
    </item>
    <item>
      <title>Re: script with symcli command not work in cron</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-with-symcli-command-not-work-in-cron/m-p/3131993#M799660</link>
      <description>I thought of a couple of things that you might check...&lt;BR /&gt;&lt;BR /&gt;In addition to checking permissions, and exporting your variables, you should make sure that the script is running under root's crontab.  Also, try sourcing the user's environmental files in the script.  That would make your script look something like this:&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/ksh&lt;BR /&gt;. /my/user's/home/directory/.profile&lt;BR /&gt;. /my/user's/home/directory/.kshrc&lt;BR /&gt;export SYMCLI_DB_FILE=/var/symapi/db/symapi_db.bin&lt;BR /&gt;&lt;BR /&gt;/usr/symcli/bin/symmir -g bcv1 query &amp;gt; /tmp/bcv_list</description>
      <pubDate>Tue, 02 Dec 2003 12:38:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-with-symcli-command-not-work-in-cron/m-p/3131993#M799660</guid>
      <dc:creator>Jeromy Gregg</dc:creator>
      <dc:date>2003-12-02T12:38:49Z</dc:date>
    </item>
    <item>
      <title>Re: script with symcli command not work in cron</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-with-symcli-command-not-work-in-cron/m-p/3131994#M799661</link>
      <description>This is the key:&lt;BR /&gt;&amp;gt;&amp;gt;The script works find if I submit in Unix promot, but it didn't work if I put the script in the cron. Any idea.&amp;gt;&amp;gt;&lt;BR /&gt;&lt;BR /&gt;When you login, your .profile is sourced which sets up your environment variables.&lt;BR /&gt;&lt;BR /&gt;Cron runs in a pseudo environment. So any environment variables needed would have to be set in the script.  &lt;BR /&gt;&lt;BR /&gt;set -x will help you find what is not being set.</description>
      <pubDate>Tue, 02 Dec 2003 12:48:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-with-symcli-command-not-work-in-cron/m-p/3131994#M799661</guid>
      <dc:creator>Cheryl Griffin</dc:creator>
      <dc:date>2003-12-02T12:48:58Z</dc:date>
    </item>
    <item>
      <title>Re: script with symcli command not work in cron</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-with-symcli-command-not-work-in-cron/m-p/3131995#M799662</link>
      <description>Hi Simon,&lt;BR /&gt;&lt;BR /&gt;since you do not redirect errors, you might find error ouput in mail.&lt;BR /&gt;If the command ran, it should have created /tmp/bcv_list no matter what other errors come from the programme.&lt;BR /&gt;Can you post the crontab entry?&lt;BR /&gt;&lt;BR /&gt;use:&lt;BR /&gt;#!/usr/bin/ksh&lt;BR /&gt;export SYMCLI_DB_FILE=/var/symapi/db/symapi_db.bin&lt;BR /&gt;/usr/symcli/bin/symmir -g bcv1 query &amp;gt; /tmp/bcv_list 2&amp;gt;&amp;amp;1&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;greetings,&lt;BR /&gt;&lt;BR /&gt;Michael&lt;BR /&gt;</description>
      <pubDate>Tue, 02 Dec 2003 13:14:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-with-symcli-command-not-work-in-cron/m-p/3131995#M799662</guid>
      <dc:creator>Michael Schulte zur Sur</dc:creator>
      <dc:date>2003-12-02T13:14:18Z</dc:date>
    </item>
    <item>
      <title>Re: script with symcli command not work in cron</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-with-symcli-command-not-work-in-cron/m-p/3131996#M799663</link>
      <description>thanks everyone, it works now.</description>
      <pubDate>Tue, 02 Dec 2003 13:29:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-with-symcli-command-not-work-in-cron/m-p/3131996#M799663</guid>
      <dc:creator>Camel_1</dc:creator>
      <dc:date>2003-12-02T13:29:46Z</dc:date>
    </item>
    <item>
      <title>Re: script with symcli command not work in cron</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-with-symcli-command-not-work-in-cron/m-p/3131997#M799664</link>
      <description>Hi Simon,&lt;BR /&gt;&lt;BR /&gt;thanks for the points. Would you enlighten us as to the cause of the problem and the solution?&lt;BR /&gt;&lt;BR /&gt;thanks,&lt;BR /&gt;&lt;BR /&gt;Michael&lt;BR /&gt;</description>
      <pubDate>Tue, 02 Dec 2003 13:38:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-with-symcli-command-not-work-in-cron/m-p/3131997#M799664</guid>
      <dc:creator>Michael Schulte zur Sur</dc:creator>
      <dc:date>2003-12-02T13:38:37Z</dc:date>
    </item>
  </channel>
</rss>

