<?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: activating crontab in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/activating-crontab/m-p/3676130#M244602</link>
    <description>No, when you save the file a crobtab command is automatically executed. However, the preferred way (meaning the way that I do it) is:&lt;BR /&gt;&lt;BR /&gt;crontab -l &amp;gt; user_crontab&lt;BR /&gt;edit user_crontab using the editor of your choice&lt;BR /&gt;crontab &amp;lt; user_crontab # updates your existing crontab entry and sends a SIGHUP to cron.&lt;BR /&gt;&lt;BR /&gt;This method allows you to actually keep a copy of your file. You can always use contab -l to list your current crontab entries.&lt;BR /&gt;&lt;BR /&gt;As with all the variant of crontab, take care because if you simply entry "crontab"; the command will wait for you to enter data and then rewrite your (now probably empty) crontab.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Mon, 21 Nov 2005 18:49:18 GMT</pubDate>
    <dc:creator>A. Clay Stephenson</dc:creator>
    <dc:date>2005-11-21T18:49:18Z</dc:date>
    <item>
      <title>activating crontab</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/activating-crontab/m-p/3676129#M244601</link>
      <description>Dear Sirs,&lt;BR /&gt;&lt;BR /&gt;I just put a shell script in crontab of the root.&lt;BR /&gt;&lt;BR /&gt;I used the command crontab -e.&lt;BR /&gt;&lt;BR /&gt;Do i need to use any command to activate this ?&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Shiv</description>
      <pubDate>Mon, 21 Nov 2005 18:43:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/activating-crontab/m-p/3676129#M244601</guid>
      <dc:creator>Shivkumar</dc:creator>
      <dc:date>2005-11-21T18:43:12Z</dc:date>
    </item>
    <item>
      <title>Re: activating crontab</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/activating-crontab/m-p/3676130#M244602</link>
      <description>No, when you save the file a crobtab command is automatically executed. However, the preferred way (meaning the way that I do it) is:&lt;BR /&gt;&lt;BR /&gt;crontab -l &amp;gt; user_crontab&lt;BR /&gt;edit user_crontab using the editor of your choice&lt;BR /&gt;crontab &amp;lt; user_crontab # updates your existing crontab entry and sends a SIGHUP to cron.&lt;BR /&gt;&lt;BR /&gt;This method allows you to actually keep a copy of your file. You can always use contab -l to list your current crontab entries.&lt;BR /&gt;&lt;BR /&gt;As with all the variant of crontab, take care because if you simply entry "crontab"; the command will wait for you to enter data and then rewrite your (now probably empty) crontab.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 21 Nov 2005 18:49:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/activating-crontab/m-p/3676130#M244602</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2005-11-21T18:49:18Z</dc:date>
    </item>
    <item>
      <title>Re: activating crontab</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/activating-crontab/m-p/3676131#M244603</link>
      <description>if you put a programm there, in cront, you have to make the scripts and develop it with all abolutes paths.&lt;BR /&gt;&lt;BR /&gt;&amp;lt;&amp;gt;&amp;lt; Manuales</description>
      <pubDate>Mon, 21 Nov 2005 18:51:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/activating-crontab/m-p/3676131#M244603</guid>
      <dc:creator>Manuales</dc:creator>
      <dc:date>2005-11-21T18:51:14Z</dc:date>
    </item>
    <item>
      <title>Re: activating crontab</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/activating-crontab/m-p/3676132#M244604</link>
      <description>I have submitted the cron job. I checked with "ps -ef|grep scriptname" command but it is not showing up.</description>
      <pubDate>Mon, 21 Nov 2005 19:01:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/activating-crontab/m-p/3676132#M244604</guid>
      <dc:creator>Shivkumar</dc:creator>
      <dc:date>2005-11-21T19:01:17Z</dc:date>
    </item>
    <item>
      <title>Re: activating crontab</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/activating-crontab/m-p/3676133#M244605</link>
      <description>Hi SHiv:&lt;BR /&gt;&lt;BR /&gt;You will not see your command run until it's time specification has been met.&lt;BR /&gt;&lt;BR /&gt;You can find the return code (rc) of your crontask in '/var/adm/cron/log'.&lt;BR /&gt;&lt;BR /&gt;Remember that the environment that the 'cron' daemon establishes is very sparse.  Most notably, your PATH is only :&lt;BR /&gt;&lt;BR /&gt;PATH=/usr/bin:/usr/sbin:.&lt;BR /&gt;&lt;BR /&gt;Thus, unless you source your $HOME/.profile or some other file of environmental variables that your script needs, they will be lacking.  This is one of the most usual reasons for finding that a script runs OK until it is added to a crontab.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF... &lt;BR /&gt;</description>
      <pubDate>Mon, 21 Nov 2005 19:21:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/activating-crontab/m-p/3676133#M244605</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2005-11-21T19:21:57Z</dc:date>
    </item>
    <item>
      <title>Re: activating crontab</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/activating-crontab/m-p/3676134#M244606</link>
      <description>Here is entry for cron job:-&lt;BR /&gt;&lt;BR /&gt;* * * * * /home/sksonkar/scripts/ROSE/PINK-RED.sh  &amp;gt;/dev/null 2&amp;gt;&amp;amp;1&lt;BR /&gt;&lt;BR /&gt;I have given first line in the script as #!/usr/bin/ksh.&lt;BR /&gt;&lt;BR /&gt;------&lt;BR /&gt;&lt;BR /&gt;The output of "env" is has PATH set as:-&lt;BR /&gt;&lt;BR /&gt;PATH=/opt/socks/bin:/usr/bin:/usr/ccs/bin:/usr/contrib/bin:/opt/fc/bin:/opt/fcms/bin:/opt/nettladm/bin:/opt/upgrade/bin:/opt/pd/bin:/usr/bin/X11:/usr/contrib/bin/X11:/opt/pb/bin:/opt/resmon/bin:/usr/sbin/diag/contrib:/opt/pred/bin:/opt/perf/bin://opt/perl/bin:/opt/hparray/bin:/opt/sec_mgmt/bastille/bin:/opt/pwplus/bin:/opt/graphics/common/bin:/opt/OV/bin/OpC:/usr/sbin:.&lt;BR /&gt;&lt;BR /&gt;The other line is:-&lt;BR /&gt;PWD=/home/sksonkar/scripts/ROSE&lt;BR /&gt;&lt;BR /&gt;Please suggest how do i source the environnment variable "=/home/sksonkar/scripts/ROSE" permanently.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Shiv</description>
      <pubDate>Mon, 21 Nov 2005 19:49:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/activating-crontab/m-p/3676134#M244606</guid>
      <dc:creator>Shivkumar</dc:creator>
      <dc:date>2005-11-21T19:49:08Z</dc:date>
    </item>
    <item>
      <title>Re: activating crontab</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/activating-crontab/m-p/3676135#M244607</link>
      <description>Hi Shiv:&lt;BR /&gt;&lt;BR /&gt;One very clean way to handle environmental variables that you may want to use generally in scripts, is to create your own file that you can "source" (read) whenever you need it.  For example:&lt;BR /&gt;&lt;BR /&gt;# cat /home/sksonkar/env&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;export PATH=$PATH:/home/sksonkar/scripts/ROSE&lt;BR /&gt;export ME=shivkumar&lt;BR /&gt;&lt;BR /&gt;Then, when you want the your environement to contain your updated PATH and the varible ME (for example) you add this to the script that needs this information:&lt;BR /&gt;&lt;BR /&gt;. /home/sksonkar/env &lt;BR /&gt;&lt;BR /&gt;...Note the dot character (".") followed by a space (blank) followed the absolute path of the file you want to read "into" your script.  This is what is called "sourcing" a file.&lt;BR /&gt;&lt;BR /&gt;The concept is that you make ONE copy of key variables you need and then you read them whenever you need them.  It's one-stop maintenance when you want to change something!&lt;BR /&gt;&lt;BR /&gt;The file of your variables can also be sourced at the end of your login profile.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Mon, 21 Nov 2005 20:09:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/activating-crontab/m-p/3676135#M244607</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2005-11-21T20:09:14Z</dc:date>
    </item>
    <item>
      <title>Re: activating crontab</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/activating-crontab/m-p/3676136#M244608</link>
      <description>hi shiv,&lt;BR /&gt;&lt;BR /&gt;I prefer to spool the error and output logs to a logfile so that i can verify it if anything went wrong.&lt;BR /&gt;&lt;BR /&gt;e.g.&lt;BR /&gt;  *     *   *     *     *     echo "/home/yogeeraj/sql/scheduled/fetchdata.sh" | su - oracle 1&amp;gt;/home/yogeeraj/logfiles/output-fetchdata.crn 2&amp;gt;/home/yogeeraj/logfiles/error-fetchdata.crn&lt;BR /&gt;#*******************************************************************************&lt;BR /&gt;# min|hour |day  |month|day  |script&lt;BR /&gt;#    |     |of mo|     |of wk|&lt;BR /&gt;#----|-----|-----|-----|-----|--------------------------------------------------&lt;BR /&gt;#*******************************************************************************&lt;BR /&gt;#*******************************************************************************&lt;BR /&gt;# END OF TABLE           day0-&amp;gt;Sunday  day6-&amp;gt;Saturday&lt;BR /&gt;#*******************************************************************************&lt;BR /&gt;&lt;BR /&gt;in the case, you are running it every minute, this might not be too relevant though.. but might help troubleshoot.&lt;BR /&gt;&lt;BR /&gt;regards&lt;BR /&gt;yogeeraj</description>
      <pubDate>Mon, 21 Nov 2005 23:19:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/activating-crontab/m-p/3676136#M244608</guid>
      <dc:creator>Yogeeraj_1</dc:creator>
      <dc:date>2005-11-21T23:19:01Z</dc:date>
    </item>
    <item>
      <title>Re: activating crontab</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/activating-crontab/m-p/3676137#M244609</link>
      <description>I exported the variable and it worked. &lt;BR /&gt;i used the command &lt;BR /&gt;export PATH=$PATH:/home/sksonkar/scripts/ROSE &lt;BR /&gt;&lt;BR /&gt;I have the root access ( power broker ). This script is owned by some other user. &lt;BR /&gt;&lt;BR /&gt;This script will be running in the crontab of "root" user.&lt;BR /&gt;&lt;BR /&gt;When i exited the root shell; script stopped working. I think the environment variable have got lost.&lt;BR /&gt;&lt;BR /&gt;How do I make it a permanent change ?&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Shiv&lt;BR /&gt;</description>
      <pubDate>Tue, 22 Nov 2005 12:30:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/activating-crontab/m-p/3676137#M244609</guid>
      <dc:creator>Shivkumar</dc:creator>
      <dc:date>2005-11-22T12:30:05Z</dc:date>
    </item>
    <item>
      <title>Re: activating crontab</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/activating-crontab/m-p/3676138#M244610</link>
      <description>YOu really should add this line:&lt;BR /&gt;&lt;BR /&gt; export PATH=$PATH:/home/sksonkar/scripts/ROSE &lt;BR /&gt;&lt;BR /&gt;into the script you are running.  That will set the path every time the script runs.</description>
      <pubDate>Tue, 22 Nov 2005 12:34:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/activating-crontab/m-p/3676138#M244610</guid>
      <dc:creator>Patrick Wallek</dc:creator>
      <dc:date>2005-11-22T12:34:32Z</dc:date>
    </item>
    <item>
      <title>Re: activating crontab</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/activating-crontab/m-p/3676139#M244611</link>
      <description>Patrick,&lt;BR /&gt;&lt;BR /&gt;I just added below in the script:&lt;BR /&gt;export PATH=$PATH:/home/sksonkar/scripts/ROSE &lt;BR /&gt;&lt;BR /&gt;It didn't help.&lt;BR /&gt;&lt;BR /&gt;Do i need to do sourcing etc too ?</description>
      <pubDate>Tue, 22 Nov 2005 16:29:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/activating-crontab/m-p/3676139#M244611</guid>
      <dc:creator>Shivkumar</dc:creator>
      <dc:date>2005-11-22T16:29:09Z</dc:date>
    </item>
    <item>
      <title>Re: activating crontab</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/activating-crontab/m-p/3676140#M244612</link>
      <description>If this script, in turn, calls other shell scripts or executables that are outside cron's very limited PATH then yes. The other option is to make sure that all the scripts within your parent script use absolute paths --- and the ones that these scripts in turn call --- and so on. That's why is is better to source an environment file. THat will take care of PATH plus any other needed environment variables.</description>
      <pubDate>Tue, 22 Nov 2005 16:37:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/activating-crontab/m-p/3676140#M244612</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2005-11-22T16:37:26Z</dc:date>
    </item>
    <item>
      <title>Re: activating crontab</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/activating-crontab/m-p/3676141#M244613</link>
      <description>What are the steps required to source the path ?&lt;BR /&gt;&lt;BR /&gt;I am using power broker root access.&lt;BR /&gt;&lt;BR /&gt;Here is the path where the scripts are stored :&lt;BR /&gt;/home/bigman/scripts/ROSE/&lt;BR /&gt;&lt;BR /&gt;The user is someone else. &lt;BR /&gt;&lt;BR /&gt;I belive env variable are stored in user's .profile file.&lt;BR /&gt;&lt;BR /&gt;The current script will be running as power broker (root) user because user is not permitted to run cron job with his own id.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Shiv&lt;BR /&gt;&lt;BR /&gt; &lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 22 Nov 2005 16:58:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/activating-crontab/m-p/3676141#M244613</guid>
      <dc:creator>Shivkumar</dc:creator>
      <dc:date>2005-11-22T16:58:32Z</dc:date>
    </item>
    <item>
      <title>Re: activating crontab</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/activating-crontab/m-p/3676142#M244614</link>
      <description>Reading in the user's .profile is less than perfect because the .profile will almost certainly have statements (e.g. tset, tput, tabs) which will depend upon an interactive environment -- which you ain't under cron.&lt;BR /&gt;&lt;BR /&gt;My preferred method is to actually yank out all of the required environment setup command out of the the user's .profile and put them in a file (e.g. /usr/local/bin/userfredstuff.sh). This file miust not contain an exit or return statement.&lt;BR /&gt;&lt;BR /&gt;Now both your script and fred's .profile source this file via the . (dot) operator.&lt;BR /&gt;. /usr/local/bin/userfredstuff.sh.&lt;BR /&gt;&lt;BR /&gt;This means that the environment variables only have to be changed in one place and in other user's need the same environment they can source this file as well.&lt;BR /&gt;&lt;BR /&gt;The other method is to source .profile but surround all of the command which expect stdin to be a terminal with&lt;BR /&gt;if [[ -t 0 ]]&lt;BR /&gt;  then&lt;BR /&gt;    tset ...&lt;BR /&gt;    tput ...&lt;BR /&gt;  fi&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 22 Nov 2005 17:06:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/activating-crontab/m-p/3676142#M244614</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2005-11-22T17:06:33Z</dc:date>
    </item>
    <item>
      <title>Re: activating crontab</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/activating-crontab/m-p/3676143#M244615</link>
      <description>Hi Shiv:&lt;BR /&gt;&lt;BR /&gt;You asked "what are the steps required to source the path".&lt;BR /&gt;&lt;BR /&gt;If you return to my response above you will see that "sourcing" is a facny term for "reading".  To source one file "into" another you use the notation of a dot ("." followed by a space character, followed by the path of the script that you want to be read.  An absolute path is preferred.&lt;BR /&gt;&lt;BR /&gt;You *can* source your $HOME/.profile although this leads to other issues unless you take care of them first in your profile! (but that's another subject).&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 22 Nov 2005 17:11:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/activating-crontab/m-p/3676143#M244615</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2005-11-22T17:11:22Z</dc:date>
    </item>
    <item>
      <title>Re: activating crontab</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/activating-crontab/m-p/3676144#M244616</link>
      <description>Hi Shiv:&lt;BR /&gt;&lt;BR /&gt;You asked "what are the steps required to source the path".&lt;BR /&gt;&lt;BR /&gt;If you return to my response above you will see that "sourcing" is a facny term for "reading".  To source one file "into" another you use the notation of a dot (".")followed by a space character, followed by the path of the script that you want to be read.  An absolute path is preferred.&lt;BR /&gt;&lt;BR /&gt;You *can* source your $HOME/.profile although this leads to other issues unless you take care of them first in your profile! (but that's another subject).&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 22 Nov 2005 17:11:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/activating-crontab/m-p/3676144#M244616</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2005-11-22T17:11:26Z</dc:date>
    </item>
  </channel>
</rss>

