<?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: crontab - script is not running in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/crontab-script-is-not-running/m-p/5140001#M452178</link>
    <description>Hi,&lt;BR /&gt;&lt;BR /&gt;What about the file permission.?&lt;BR /&gt;Copy the script to /usr/bin and give necessary permission and try.&lt;BR /&gt;&lt;BR /&gt;As per crontab entry script will run on 24th min of each hr ,Sat , when date is &amp;lt; 9.&lt;BR /&gt;&lt;BR /&gt;Correct if I m wrong.&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;Sen</description>
    <pubDate>Sat, 08 Nov 2008 19:33:14 GMT</pubDate>
    <dc:creator>sen_ux</dc:creator>
    <dc:date>2008-11-08T19:33:14Z</dc:date>
    <item>
      <title>crontab - script is not running</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/crontab-script-is-not-running/m-p/5140000#M452177</link>
      <description>Hello,&lt;BR /&gt;&lt;BR /&gt;I need to run a script in crontab.If iam running the script manually it is running perfectly.Through crontab its not running.the script is rebooting the sever for a particular day:eg.&lt;BR /&gt;---------------------&lt;BR /&gt;#!/sbin/sh&lt;BR /&gt;&lt;BR /&gt;DAYOFWEEK=`/usr/bin/date +%u`&lt;BR /&gt;DATE=`/usr/bin/date +%d`&lt;BR /&gt;if [ ${DAYOFWEEK} -eq "6" ] &amp;amp;&amp;amp; [ ${DATE} -lt '9' ]&lt;BR /&gt;then&lt;BR /&gt;echo "rebooting server"&lt;BR /&gt;/usr/bin/cd /&lt;BR /&gt;/sbin/shutdown -r now&lt;BR /&gt;fi&lt;BR /&gt;--------------------&lt;BR /&gt;The crontab entry I don is:&lt;BR /&gt;# crontab -l&lt;BR /&gt;&lt;BR /&gt;24 * * * * /test.sh&lt;BR /&gt;==========================&lt;BR /&gt;&lt;BR /&gt;its not at all running.I checked with other comands like &lt;BR /&gt;&lt;BR /&gt;55 * * * * /sbin/reboot&lt;BR /&gt;----------------------------is working perfectly.Could you pls suggest?</description>
      <pubDate>Sat, 08 Nov 2008 16:07:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/crontab-script-is-not-running/m-p/5140000#M452177</guid>
      <dc:creator>Sreer</dc:creator>
      <dc:date>2008-11-08T16:07:12Z</dc:date>
    </item>
    <item>
      <title>Re: crontab - script is not running</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/crontab-script-is-not-running/m-p/5140001#M452178</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;What about the file permission.?&lt;BR /&gt;Copy the script to /usr/bin and give necessary permission and try.&lt;BR /&gt;&lt;BR /&gt;As per crontab entry script will run on 24th min of each hr ,Sat , when date is &amp;lt; 9.&lt;BR /&gt;&lt;BR /&gt;Correct if I m wrong.&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;Sen</description>
      <pubDate>Sat, 08 Nov 2008 19:33:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/crontab-script-is-not-running/m-p/5140001#M452178</guid>
      <dc:creator>sen_ux</dc:creator>
      <dc:date>2008-11-08T19:33:14Z</dc:date>
    </item>
    <item>
      <title>Re: crontab - script is not running</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/crontab-script-is-not-running/m-p/5140002#M452179</link>
      <description>Two reasons I can think of:&lt;BR /&gt;1. File permission (execute permission).&lt;BR /&gt;2. Path of the script (specify the complete path), from your example the file should be located in root (/).</description>
      <pubDate>Sat, 08 Nov 2008 21:22:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/crontab-script-is-not-running/m-p/5140002#M452179</guid>
      <dc:creator>~sesh</dc:creator>
      <dc:date>2008-11-08T21:22:54Z</dc:date>
    </item>
    <item>
      <title>Re: crontab - script is not running</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/crontab-script-is-not-running/m-p/5140003#M452180</link>
      <description>easier and simple way,&lt;BR /&gt;&lt;BR /&gt;direct specify the command in the crontab for root will do the Job for us.&lt;BR /&gt;&lt;BR /&gt;Example :-&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;55 * * * * /usr/sbin/shutdown -ry 0&lt;BR /&gt;&lt;BR /&gt;or,&lt;BR /&gt;&lt;BR /&gt;Check your file permission of the script.?&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Johnson&lt;BR /&gt;</description>
      <pubDate>Sun, 09 Nov 2008 02:56:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/crontab-script-is-not-running/m-p/5140003#M452180</guid>
      <dc:creator>Johnson Punniyalingam</dc:creator>
      <dc:date>2008-11-09T02:56:25Z</dc:date>
    </item>
    <item>
      <title>Re: crontab - script is not running</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/crontab-script-is-not-running/m-p/5140004#M452181</link>
      <description>&lt;!--!*#--&gt;&amp;gt;If i am running the script manually it is running perfectly&lt;BR /&gt;&lt;BR /&gt;I don't see how?&lt;BR /&gt;DAYOFWEEK=$(date +%w)&lt;BR /&gt;DATE=$(date +%d)&lt;BR /&gt;if [ ${DAYOFWEEK} -eq 6 -a ${DATE} -lt 9 ]; then&lt;BR /&gt;   echo "rebooting server"&lt;BR /&gt;   cd /&lt;BR /&gt;   /sbin/shutdown -r now&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;There was no need for /usr/bin in your paths.  Your "if" syntax was wrong.  And you must NOT use anything but a shell builtin for cd.&lt;BR /&gt;&lt;BR /&gt;Note if this is used by crontab, there isn't any reason to check for both day of week and day of month.  One can be done in crontab but you may want the script to run manually.&lt;BR /&gt;I also switched to %w so it matches crontab's numbering.&lt;BR /&gt;&lt;BR /&gt;As Sen mentioned, you need to specify the hour of the day, this is Saturday at 0024:&lt;BR /&gt;24 00 * * 6 /test.sh&lt;BR /&gt;&lt;BR /&gt;But the real question is, why do you want to reboot your server?&lt;BR /&gt;&lt;BR /&gt;&amp;gt;Johnson: easier and simple way, directly specify the command&lt;BR /&gt;&lt;BR /&gt;This doesn't meet the AND criteria.</description>
      <pubDate>Sun, 09 Nov 2008 04:22:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/crontab-script-is-not-running/m-p/5140004#M452181</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2008-11-09T04:22:20Z</dc:date>
    </item>
    <item>
      <title>Re: crontab - script is not running</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/crontab-script-is-not-running/m-p/5140005#M452182</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;leaving the invalid test expression beside,&lt;BR /&gt;it is rarely advised to use&lt;BR /&gt;/usr/bin/cd otherdir&lt;BR /&gt;This form is mainly available for some compatibility reasons only: creating a new process for a command, the change of the directory will be valid only during the runtime of this process. That may be intersting for testing purposes.&lt;BR /&gt;&lt;BR /&gt;Always use a simple&lt;BR /&gt;cd otherdir&lt;BR /&gt;if you really want to do a 'change directory'.&lt;BR /&gt;&lt;BR /&gt;mfG Peter</description>
      <pubDate>Mon, 10 Nov 2008 07:53:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/crontab-script-is-not-running/m-p/5140005#M452182</guid>
      <dc:creator>Peter Nikitka</dc:creator>
      <dc:date>2008-11-10T07:53:49Z</dc:date>
    </item>
    <item>
      <title>Re: crontab - script is not running</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/crontab-script-is-not-running/m-p/5140006#M452183</link>
      <description>Shalom,&lt;BR /&gt;&lt;BR /&gt;One question:&lt;BR /&gt;Where is your PATH variable.&lt;BR /&gt;&lt;BR /&gt;crontab runs scripts with no environment in cron. No PATH no finding binaries.&lt;BR /&gt;&lt;BR /&gt;Most common cause of problems.&lt;BR /&gt;&lt;BR /&gt;The crontab entry /test.sh requires the script to be in the root directory. Bad sysadmin practice.&lt;BR /&gt;&lt;BR /&gt;SEP</description>
      <pubDate>Mon, 10 Nov 2008 08:59:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/crontab-script-is-not-running/m-p/5140006#M452183</guid>
      <dc:creator>Steven E. Protter</dc:creator>
      <dc:date>2008-11-10T08:59:04Z</dc:date>
    </item>
    <item>
      <title>Re: crontab - script is not running</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/crontab-script-is-not-running/m-p/5140007#M452184</link>
      <description>Hello all,&lt;BR /&gt;thanks for your reply.&lt;BR /&gt;the script is having executive permission [777].&lt;BR /&gt;It is located in / only.&lt;BR /&gt;The script its self is running fine.&lt;BR /&gt;when iam putting in cron its not running.&lt;BR /&gt;My requirement is to reboot server on every particular day of the week for 3 months.&lt;BR /&gt;so i cant give /sbin/reboot.&lt;BR /&gt;Thanks&lt;BR /&gt;Sreekumar.r</description>
      <pubDate>Mon, 10 Nov 2008 09:38:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/crontab-script-is-not-running/m-p/5140007#M452184</guid>
      <dc:creator>Sreer</dc:creator>
      <dc:date>2008-11-10T09:38:42Z</dc:date>
    </item>
    <item>
      <title>Re: crontab - script is not running</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/crontab-script-is-not-running/m-p/5140008#M452185</link>
      <description>&amp;gt;when I am putting in cron its not running.&lt;BR /&gt;&lt;BR /&gt;Have you tried my specific changes?&lt;BR /&gt;&lt;BR /&gt;&amp;gt;Peter: it is rarely advised to use /usr/bin/cd&lt;BR /&gt;&lt;BR /&gt;I would state this far stronger.  Never use /usr/bin/cd. :-)&lt;BR /&gt;This is only for standards compliance, useless for ordinary users.  cd(1) states one use, to check the exit status for directory accessibility.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;SEP: crontab runs scripts with no environment in cron.&lt;BR /&gt;&lt;BR /&gt;crontab(1) sets PATH to: PATH=/usr/bin:/usr/sbin:.</description>
      <pubDate>Mon, 10 Nov 2008 10:56:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/crontab-script-is-not-running/m-p/5140008#M452185</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2008-11-10T10:56:24Z</dc:date>
    </item>
    <item>
      <title>Re: crontab - script is not running</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/crontab-script-is-not-running/m-p/5140009#M452186</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;To high-light Dennis's comment regarding 'cd' versus '/usr/bin/cd', simply compare:&lt;BR /&gt;&lt;BR /&gt;# cd /var &amp;amp;&amp;amp; pwd&lt;BR /&gt;/var&lt;BR /&gt;# pwd&lt;BR /&gt;# /usr/bin/cd /tmp &amp;amp;&amp;amp; pwd&lt;BR /&gt;/var&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;BR /&gt;</description>
      <pubDate>Mon, 10 Nov 2008 13:19:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/crontab-script-is-not-running/m-p/5140009#M452186</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2008-11-10T13:19:10Z</dc:date>
    </item>
    <item>
      <title>Re: crontab - script is not running</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/crontab-script-is-not-running/m-p/5140010#M452187</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;check the /var/adm/cron/log for information of how the script was executed.&lt;BR /&gt;Check also the mail to the root user ( which I assume you are using).&lt;BR /&gt;&lt;BR /&gt;regards,&lt;BR /&gt;John K.</description>
      <pubDate>Mon, 10 Nov 2008 13:58:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/crontab-script-is-not-running/m-p/5140010#M452187</guid>
      <dc:creator>john korterman</dc:creator>
      <dc:date>2008-11-10T13:58:41Z</dc:date>
    </item>
    <item>
      <title>Re: crontab - script is not running</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/crontab-script-is-not-running/m-p/5140011#M452188</link>
      <description>Hello all,&lt;BR /&gt;Thanls for your reply.&lt;BR /&gt;&lt;BR /&gt;Hello Dennis  thanks alot.&lt;BR /&gt;It worked I removed the path entry [ /usr/bin/cd /]&lt;BR /&gt;from crontab.Now its working fine.&lt;BR /&gt;&lt;BR /&gt;rgds Sreekumar.R</description>
      <pubDate>Mon, 10 Nov 2008 14:25:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/crontab-script-is-not-running/m-p/5140011#M452188</guid>
      <dc:creator>Sreer</dc:creator>
      <dc:date>2008-11-10T14:25:29Z</dc:date>
    </item>
    <item>
      <title>Re: crontab - script is not running</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/crontab-script-is-not-running/m-p/5140012#M452189</link>
      <description>Hey;&lt;BR /&gt;&lt;BR /&gt;Please change those permissions.  With 777 permissions, anyone who wants to can take control of your box as of the next saturday.&lt;BR /&gt;&lt;BR /&gt;Since they can write to the file, all they have to do is add:&lt;BR /&gt;&lt;BR /&gt;cp /bin/ksh /tmp/give_me_root&lt;BR /&gt;chown root:sys /tmp/give_me_root&lt;BR /&gt;chmod 1755 /tmp/give_me_root&lt;BR /&gt;&lt;BR /&gt;Then, wait for the nexst reboot to execute it.&lt;BR /&gt;&lt;BR /&gt;Doug</description>
      <pubDate>Mon, 10 Nov 2008 16:24:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/crontab-script-is-not-running/m-p/5140012#M452189</guid>
      <dc:creator>Doug O'Leary</dc:creator>
      <dc:date>2008-11-10T16:24:54Z</dc:date>
    </item>
    <item>
      <title>Re: crontab - script is not running</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/crontab-script-is-not-running/m-p/5140013#M452190</link>
      <description>Hello all,&lt;BR /&gt;ThanKs for your reply.&lt;BR /&gt;It worked I removed the path entry [ /usr/bin/cd /]&lt;BR /&gt;from crontab.Now its working fine.&lt;BR /&gt;&lt;BR /&gt;rgds Sreekumar.R</description>
      <pubDate>Tue, 11 Nov 2008 14:16:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/crontab-script-is-not-running/m-p/5140013#M452190</guid>
      <dc:creator>Sreer</dc:creator>
      <dc:date>2008-11-11T14:16:03Z</dc:date>
    </item>
  </channel>
</rss>

