<?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 on solaris in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/crontab-on-solaris/m-p/3791998#M781783</link>
    <description>Thaks for answers...&lt;BR /&gt;But I am new in solaris...and this is machine in production...and before I do anything let me ask U one more thing..&lt;BR /&gt;when I type env I get all those variables..can I just copy them as they are and inport it simply in headear of my script??&lt;BR /&gt;justi like this:&lt;BR /&gt;&lt;BR /&gt;myscript:&lt;BR /&gt;&lt;BR /&gt;#!/bin/sh&lt;BR /&gt;d=`date +%d%m%y%H%M%S`&lt;BR /&gt;dir="/opt/tomcat/logs"&lt;BR /&gt;/bin/rm $dir/me/old &lt;BR /&gt;/bin/mv $dir/me/new $dir/me/old&lt;BR /&gt;/bin/cp $dir/catalina.out $dir/me/new&lt;BR /&gt;&lt;BR /&gt;/bin/diff $dir/me/new $dir/me/old &amp;gt; $dir/me/diffre&lt;BR /&gt;&lt;BR /&gt;/bin/chmod 777 $dir/me/diffre&lt;BR /&gt;/bin/grep "no stack trace available" $dir/me/diffre &amp;gt; $dir/me/newfile&lt;BR /&gt;...&lt;BR /&gt;....&lt;BR /&gt;......&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;and bake my script like this:&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;#!/bin/sh&lt;BR /&gt;_=/usr/bin/env&lt;BR /&gt;MANPATH=/usr/share/man:/usr/local/man&lt;BR /&gt;HZ=100&lt;BR /&gt;LC_MONETARY=en_US&lt;BR /&gt;LC_TIME=en_US&lt;BR /&gt;PATH=/usr/sbin:/usr/bin:/usr/local/bin:.:/usr/opt/SUNWmd/sbin&lt;BR /&gt;LOGNAME=me&lt;BR /&gt;MAIL=/var/mail/me&lt;BR /&gt;PS1=anes@machine:$PWD&lt;BR /&gt;&amp;gt;&lt;BR /&gt;LC_MESSAGES=C&lt;BR /&gt;LC_CTYPE=en_US&lt;BR /&gt;SHELL=/usr/bin/ksh&lt;BR /&gt;HOME=/home1/scriptPOOL&lt;BR /&gt;LC_COLLATE=en_US&lt;BR /&gt;LC_NUMERIC=en_US&lt;BR /&gt;TERM=vt100&lt;BR /&gt;PWD=/home1/scriptPOOL&lt;BR /&gt;TZ=MET&lt;BR /&gt;&lt;BR /&gt;d=`date +%d%m%y%H%M%S`&lt;BR /&gt;dir="/opt/tomcat/logs"&lt;BR /&gt;/bin/rm $dir/me/old &lt;BR /&gt;/bin/mv $dir/me/new $dir/me/old&lt;BR /&gt;/bin/cp $dir/catalina.out $dir/me/new&lt;BR /&gt;&lt;BR /&gt;/bin/diff $dir/me/new $dir/me/old &amp;gt; $dir/me/diffre&lt;BR /&gt;&lt;BR /&gt;/bin/chmod 777 $dir/me/diffre&lt;BR /&gt;/bin/grep "error" $dir/me/diffre &amp;gt; $dir/me/newfile&lt;BR /&gt;...&lt;BR /&gt;....&lt;BR /&gt;......&lt;BR /&gt;&lt;BR /&gt;if I understand Bill ok??&lt;BR /&gt;&lt;BR /&gt;Thanks in advance..</description>
    <pubDate>Tue, 23 May 2006 01:04:42 GMT</pubDate>
    <dc:creator>amonamon</dc:creator>
    <dc:date>2006-05-23T01:04:42Z</dc:date>
    <item>
      <title>crontab on solaris</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/crontab-on-solaris/m-p/3791985#M781770</link>
      <description>Hello everyone..&lt;BR /&gt;I have problem when executing script...from command line it works perfect but when I add it to cron it starts going crasy..I know that it might be connecteed with my path variable but how can I fix that so that my script works same like from command line ./myscript&lt;BR /&gt;&lt;BR /&gt;Thanks..:)</description>
      <pubDate>Mon, 22 May 2006 01:44:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/crontab-on-solaris/m-p/3791985#M781770</guid>
      <dc:creator>amonamon</dc:creator>
      <dc:date>2006-05-22T01:44:06Z</dc:date>
    </item>
    <item>
      <title>Re: crontab on solaris</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/crontab-on-solaris/m-p/3791986#M781771</link>
      <description>Hi Amonamon,&lt;BR /&gt;&lt;BR /&gt;When you run a script manually it goes back to environment initialisation. When you run the same script through Cron, it does not run profile therefore you have to initialise the variables in the script or specify the full path.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;IA</description>
      <pubDate>Mon, 22 May 2006 02:02:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/crontab-on-solaris/m-p/3791986#M781771</guid>
      <dc:creator>Indira Aramandla</dc:creator>
      <dc:date>2006-05-22T02:02:46Z</dc:date>
    </item>
    <item>
      <title>Re: crontab on solaris</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/crontab-on-solaris/m-p/3791987#M781772</link>
      <description>&lt;BR /&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;cron invokes the command from the user's HOME directory with the shell,  (/usr/bin/sh). &lt;BR /&gt;&lt;BR /&gt;cron supplies a default environment for every shell, defining:&lt;BR /&gt;HOME=user's-home-directory&lt;BR /&gt;LOGNAME=user's-login-id&lt;BR /&gt;PATH=/usr/bin:/usr/sbin:.&lt;BR /&gt;SHELL=/usr/bin/sh&lt;BR /&gt;&lt;BR /&gt;Please make sure the ENV is set properly. That could be main suspect.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;Siva.&lt;BR /&gt;</description>
      <pubDate>Mon, 22 May 2006 02:22:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/crontab-on-solaris/m-p/3791987#M781772</guid>
      <dc:creator>Sivakumar TS</dc:creator>
      <dc:date>2006-05-22T02:22:05Z</dc:date>
    </item>
    <item>
      <title>Re: crontab on solaris</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/crontab-on-solaris/m-p/3791988#M781773</link>
      <description>Hi Amonamon,&lt;BR /&gt;&lt;BR /&gt;In crontab u have to specify the fullpath of the command which need to execute..&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Cheers&lt;BR /&gt;Arunkumar.B</description>
      <pubDate>Mon, 22 May 2006 02:22:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/crontab-on-solaris/m-p/3791988#M781773</guid>
      <dc:creator>Arunkumar.B</dc:creator>
      <dc:date>2006-05-22T02:22:59Z</dc:date>
    </item>
    <item>
      <title>Re: crontab on solaris</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/crontab-on-solaris/m-p/3791989#M781774</link>
      <description>First let me thank for answers,&lt;BR /&gt;&lt;BR /&gt;I am new in shell scripting..and I have been reading about cron..but I am not sure what should I do I am root user...with my env:&lt;BR /&gt;PWD=/var/adm&lt;BR /&gt;TZ=MET&lt;BR /&gt;_INIT_RUN_NPREV=0&lt;BR /&gt;HZ=100&lt;BR /&gt;HOSTNAME=xxdmpp&lt;BR /&gt;_INIT_RUN_LEVEL=3&lt;BR /&gt;LD_LIBRARY_PATH=/opt/SMAW/lib&lt;BR /&gt;_INIT_UTS_ISA=sparc&lt;BR /&gt;_INIT_UTS_SYSNAME=SunOS&lt;BR /&gt;_INIT_UTS_RELEASE=5.8&lt;BR /&gt;MANPATH=/usr/share/man:/opt/SMAW/man&lt;BR /&gt;_INIT_PREV_LEVEL=S&lt;BR /&gt;MACHTYPE=sparc-sun-solaris&lt;BR /&gt;MAIL=/var/mail/root&lt;BR /&gt;_INIT_UTS_VERSION=Generic_117350-05&lt;BR /&gt;JAVA_HOME=/opt/SMAW/SMAWjdk/1.2/&lt;BR /&gt;TELEESC=~&lt;BR /&gt;TELEROOT=/opt/SMAW/SMAWtssv/tele&lt;BR /&gt;LOGNAME=root&lt;BR /&gt;_INIT_UTS_NODENAME=xxdmpp&lt;BR /&gt;_INIT_UTS_PLATFORM=FJSV,GPUZC-M&lt;BR /&gt;SHLVL=1&lt;BR /&gt;_INIT_UTS_MACHINE=sun4us&lt;BR /&gt;SHELL=/bin/bash&lt;BR /&gt;HOSTTYPE=sparc&lt;BR /&gt;OSTYPE=solaris&lt;BR /&gt;HOME=/&lt;BR /&gt;TERM=vt100&lt;BR /&gt;PATH=/usr/sbin:/usr/bin:/opt/SMAW/bin:/opt/SMAW/sbin:/opt/SMAW/SMAWtssv/tele/bin&lt;BR /&gt;TELETAG=TELE&lt;BR /&gt;_INIT_NET_STRATEGY=none&lt;BR /&gt;_=/usr/bin/env&lt;BR /&gt;OLDPWD=/var/adm/log&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;and I user root crontab but my machine goes crasy basicly script does not work on good way..on a way it works from command line..&lt;BR /&gt;script is written in #!/bin/bash&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Please give me a hint..&lt;BR /&gt;&lt;BR /&gt;Cheers,</description>
      <pubDate>Mon, 22 May 2006 02:33:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/crontab-on-solaris/m-p/3791989#M781774</guid>
      <dc:creator>amonamon</dc:creator>
      <dc:date>2006-05-22T02:33:05Z</dc:date>
    </item>
    <item>
      <title>Re: crontab on solaris</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/crontab-on-solaris/m-p/3791990#M781775</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Also use script with the obsolute PATH,&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;30     18     *     *     *         &lt;PATH&gt;/&lt;SCRPIT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;Siva,&lt;/SCRPIT&gt;&lt;/PATH&gt;</description>
      <pubDate>Mon, 22 May 2006 02:33:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/crontab-on-solaris/m-p/3791990#M781775</guid>
      <dc:creator>Sivakumar TS</dc:creator>
      <dc:date>2006-05-22T02:33:56Z</dc:date>
    </item>
    <item>
      <title>Re: crontab on solaris</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/crontab-on-solaris/m-p/3791991#M781776</link>
      <description>HI Amonamon,&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Can u pls attach the crontab entry which u made ..&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Cheers &lt;BR /&gt;Arunkumar.B&lt;BR /&gt;</description>
      <pubDate>Mon, 22 May 2006 02:35:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/crontab-on-solaris/m-p/3791991#M781776</guid>
      <dc:creator>Arunkumar.B</dc:creator>
      <dc:date>2006-05-22T02:35:31Z</dc:date>
    </item>
    <item>
      <title>Re: crontab on solaris</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/crontab-on-solaris/m-p/3791992#M781777</link>
      <description>My crontab entry is:&lt;BR /&gt;&lt;BR /&gt;* 9,10,11 * * * /opt/tomcat/logs/do/myscript&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;and I put othing else in cron..this is cron from root..&lt;BR /&gt;&lt;BR /&gt;Regards,</description>
      <pubDate>Mon, 22 May 2006 02:43:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/crontab-on-solaris/m-p/3791992#M781777</guid>
      <dc:creator>amonamon</dc:creator>
      <dc:date>2006-05-22T02:43:07Z</dc:date>
    </item>
    <item>
      <title>Re: crontab on solaris</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/crontab-on-solaris/m-p/3791993#M781778</link>
      <description>anyone has a hint...how could I solve this??&lt;BR /&gt;&lt;BR /&gt;thanks in advance..</description>
      <pubDate>Mon, 22 May 2006 04:24:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/crontab-on-solaris/m-p/3791993#M781778</guid>
      <dc:creator>amonamon</dc:creator>
      <dc:date>2006-05-22T04:24:56Z</dc:date>
    </item>
    <item>
      <title>Re: crontab on solaris</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/crontab-on-solaris/m-p/3791994#M781779</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I am not sure what the script does.&lt;BR /&gt;&lt;BR /&gt;But I have few suggestion&lt;BR /&gt;&lt;BR /&gt;1. * 9,10,11 * * * /opt/tomcat/logs/do/myscript&lt;BR /&gt;&lt;BR /&gt;Change the * (Mins to a meaning full time like 30, 35 ot even 42)&lt;BR /&gt;&lt;BR /&gt;Check your cronlog, also paste it.&lt;BR /&gt;&lt;BR /&gt;Chan</description>
      <pubDate>Mon, 22 May 2006 05:17:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/crontab-on-solaris/m-p/3791994#M781779</guid>
      <dc:creator>Chan 007</dc:creator>
      <dc:date>2006-05-22T05:17:48Z</dc:date>
    </item>
    <item>
      <title>Re: crontab on solaris</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/crontab-on-solaris/m-p/3791995#M781780</link>
      <description>my script is very simple just simple copying...and where can I find cronlog to be able to sent U??&lt;BR /&gt;&lt;BR /&gt;thanks...</description>
      <pubDate>Mon, 22 May 2006 08:31:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/crontab-on-solaris/m-p/3791995#M781780</guid>
      <dc:creator>amonamon</dc:creator>
      <dc:date>2006-05-22T08:31:29Z</dc:date>
    </item>
    <item>
      <title>Re: crontab on solaris</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/crontab-on-solaris/m-p/3791996#M781781</link>
      <description>For any script, you have to know what the commands in the script require. All Unix boxes run cron jobs on behalf of the user -- there is no login. So all the settings in /etc/profile and .profile, .bashrc, etc are missing. The only way to write a shell script for cron is to assign all the variables inside the script first. Your env command shows the environment so start by copying all the variables into your script. I prefer to add only the variables that are required as the script will be simpler.&lt;BR /&gt; &lt;BR /&gt;Another technique is to source the login profiles in the script. For bash or ksh, use the . (dot or period) as the command to run the profiles as in: . /etc/profile and . $HOME/.bashrc, etc Note that if the profiles do not properly protect interactive commands (commands for terminal usage like tabs) then you'll get some warning messages about "not a typewriter" because cron has no terminal.&lt;BR /&gt;</description>
      <pubDate>Mon, 22 May 2006 08:32:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/crontab-on-solaris/m-p/3791996#M781781</guid>
      <dc:creator>Bill Hassell</dc:creator>
      <dc:date>2006-05-22T08:32:06Z</dc:date>
    </item>
    <item>
      <title>Re: crontab on solaris</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/crontab-on-solaris/m-p/3791997#M781782</link>
      <description>Hi log should be /var/adm/cron/log.&lt;BR /&gt;&lt;BR /&gt;Check what Bill said. &lt;BR /&gt;&lt;BR /&gt;Try so that you can get the log file. Change your script accordingly. Check the /tmp/t.log&lt;BR /&gt;&lt;BR /&gt;00 15 * * 1-5 /tmp/t.sh &amp;gt;/tmp/t.log 2&amp;gt;&amp;amp;1&lt;BR /&gt;&lt;BR /&gt;Chan&lt;BR /&gt;</description>
      <pubDate>Mon, 22 May 2006 08:36:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/crontab-on-solaris/m-p/3791997#M781782</guid>
      <dc:creator>Chan 007</dc:creator>
      <dc:date>2006-05-22T08:36:34Z</dc:date>
    </item>
    <item>
      <title>Re: crontab on solaris</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/crontab-on-solaris/m-p/3791998#M781783</link>
      <description>Thaks for answers...&lt;BR /&gt;But I am new in solaris...and this is machine in production...and before I do anything let me ask U one more thing..&lt;BR /&gt;when I type env I get all those variables..can I just copy them as they are and inport it simply in headear of my script??&lt;BR /&gt;justi like this:&lt;BR /&gt;&lt;BR /&gt;myscript:&lt;BR /&gt;&lt;BR /&gt;#!/bin/sh&lt;BR /&gt;d=`date +%d%m%y%H%M%S`&lt;BR /&gt;dir="/opt/tomcat/logs"&lt;BR /&gt;/bin/rm $dir/me/old &lt;BR /&gt;/bin/mv $dir/me/new $dir/me/old&lt;BR /&gt;/bin/cp $dir/catalina.out $dir/me/new&lt;BR /&gt;&lt;BR /&gt;/bin/diff $dir/me/new $dir/me/old &amp;gt; $dir/me/diffre&lt;BR /&gt;&lt;BR /&gt;/bin/chmod 777 $dir/me/diffre&lt;BR /&gt;/bin/grep "no stack trace available" $dir/me/diffre &amp;gt; $dir/me/newfile&lt;BR /&gt;...&lt;BR /&gt;....&lt;BR /&gt;......&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;and bake my script like this:&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;#!/bin/sh&lt;BR /&gt;_=/usr/bin/env&lt;BR /&gt;MANPATH=/usr/share/man:/usr/local/man&lt;BR /&gt;HZ=100&lt;BR /&gt;LC_MONETARY=en_US&lt;BR /&gt;LC_TIME=en_US&lt;BR /&gt;PATH=/usr/sbin:/usr/bin:/usr/local/bin:.:/usr/opt/SUNWmd/sbin&lt;BR /&gt;LOGNAME=me&lt;BR /&gt;MAIL=/var/mail/me&lt;BR /&gt;PS1=anes@machine:$PWD&lt;BR /&gt;&amp;gt;&lt;BR /&gt;LC_MESSAGES=C&lt;BR /&gt;LC_CTYPE=en_US&lt;BR /&gt;SHELL=/usr/bin/ksh&lt;BR /&gt;HOME=/home1/scriptPOOL&lt;BR /&gt;LC_COLLATE=en_US&lt;BR /&gt;LC_NUMERIC=en_US&lt;BR /&gt;TERM=vt100&lt;BR /&gt;PWD=/home1/scriptPOOL&lt;BR /&gt;TZ=MET&lt;BR /&gt;&lt;BR /&gt;d=`date +%d%m%y%H%M%S`&lt;BR /&gt;dir="/opt/tomcat/logs"&lt;BR /&gt;/bin/rm $dir/me/old &lt;BR /&gt;/bin/mv $dir/me/new $dir/me/old&lt;BR /&gt;/bin/cp $dir/catalina.out $dir/me/new&lt;BR /&gt;&lt;BR /&gt;/bin/diff $dir/me/new $dir/me/old &amp;gt; $dir/me/diffre&lt;BR /&gt;&lt;BR /&gt;/bin/chmod 777 $dir/me/diffre&lt;BR /&gt;/bin/grep "error" $dir/me/diffre &amp;gt; $dir/me/newfile&lt;BR /&gt;...&lt;BR /&gt;....&lt;BR /&gt;......&lt;BR /&gt;&lt;BR /&gt;if I understand Bill ok??&lt;BR /&gt;&lt;BR /&gt;Thanks in advance..</description>
      <pubDate>Tue, 23 May 2006 01:04:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/crontab-on-solaris/m-p/3791998#M781783</guid>
      <dc:creator>amonamon</dc:creator>
      <dc:date>2006-05-23T01:04:42Z</dc:date>
    </item>
    <item>
      <title>Re: crontab on solaris</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/crontab-on-solaris/m-p/3791999#M781784</link>
      <description>PS please Bill confirm this..</description>
      <pubDate>Tue, 23 May 2006 01:06:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/crontab-on-solaris/m-p/3791999#M781784</guid>
      <dc:creator>amonamon</dc:creator>
      <dc:date>2006-05-23T01:06:10Z</dc:date>
    </item>
    <item>
      <title>Re: crontab on solaris</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/crontab-on-solaris/m-p/3792000#M781785</link>
      <description>I had a similar problem on an HP9000 system and the way I could get round it was to use the 'at' command and use all the env variables it created and copy those at the top of my shell script. This did the trick for me.&lt;BR /&gt;Hope this note will help...</description>
      <pubDate>Tue, 23 May 2006 04:45:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/crontab-on-solaris/m-p/3792000#M781785</guid>
      <dc:creator>Kyris</dc:creator>
      <dc:date>2006-05-23T04:45:09Z</dc:date>
    </item>
    <item>
      <title>Re: crontab on solaris</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/crontab-on-solaris/m-p/3792001#M781786</link>
      <description>as I mention before I am beginnner...problem was in adding my script in cron I put:&lt;BR /&gt;&lt;BR /&gt;* 14,15 * * * /path/to/my/script&lt;BR /&gt;&lt;BR /&gt;so that means script executes every minute I thought that means only on 2PM and on 3PM..I was wrong..it was executing every minute..:)&lt;BR /&gt;&lt;BR /&gt;thanks everyone thru this I learned a lot more things..:)</description>
      <pubDate>Tue, 23 May 2006 06:25:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/crontab-on-solaris/m-p/3792001#M781786</guid>
      <dc:creator>amonamon</dc:creator>
      <dc:date>2006-05-23T06:25:37Z</dc:date>
    </item>
    <item>
      <title>Re: crontab on solaris</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/crontab-on-solaris/m-p/3792002#M781787</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;My question have you tried running the script once, not every minute, see below. change your script to log you error and post the errors. &lt;BR /&gt;&lt;BR /&gt;Cat /tmp/t.log will give you the errors. Post that log.&lt;BR /&gt;&lt;BR /&gt;00 15 * * 1-5 /tmp/myscript &amp;gt;/tmp/t.log 2&amp;gt;&amp;amp;1&lt;BR /&gt;&lt;BR /&gt;Chan</description>
      <pubDate>Tue, 23 May 2006 07:19:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/crontab-on-solaris/m-p/3792002#M781787</guid>
      <dc:creator>Chan 007</dc:creator>
      <dc:date>2006-05-23T07:19:18Z</dc:date>
    </item>
    <item>
      <title>Re: crontab on solaris</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/crontab-on-solaris/m-p/3792003#M781788</link>
      <description>If this is your entire script:&lt;BR /&gt; &lt;BR /&gt;&amp;gt; #!/bin/sh &lt;BR /&gt;&amp;gt; d=`date +%d%m%y%H%M%S` &lt;BR /&gt;&amp;gt; dir="/opt/tomcat/logs" &lt;BR /&gt;&amp;gt; /bin/rm $dir/me/old &lt;BR /&gt;&amp;gt; /bin/mv $dir/me/new $dir/me/old &lt;BR /&gt;&amp;gt; /bin/cp $dir/catalina.out $dir/me/new &lt;BR /&gt;&amp;gt;&lt;BR /&gt;&amp;gt; /bin/diff $dir/me/new $dir/me/old &amp;gt; $dir/me/diffre &lt;BR /&gt;&amp;gt;&lt;BR /&gt;&amp;gt; /bin/chmod 777 $dir/me/diffre &lt;BR /&gt;&amp;gt; /bin/grep "no stack trace available" $dir/me/diffre &amp;gt; $dir/me/newfile &lt;BR /&gt; &lt;BR /&gt;then you don't need any additional variables defined. I misunderstood the problem as one where the script was failing with error messages or not performing the required task. It sounds like the script is just running too many times which is simply specifying the cron values correctly.&lt;BR /&gt; &lt;BR /&gt;Here is a simplified version of your script:&lt;BR /&gt; &lt;BR /&gt;#!/bin/sh&lt;BR /&gt;PATH=/bin&lt;BR /&gt;set -u&lt;BR /&gt; &lt;BR /&gt;d=`date +%d%m%y%H%M%S` &lt;BR /&gt;dir="/opt/tomcat/logs" &lt;BR /&gt;rm $dir/me/old &lt;BR /&gt;mv $dir/me/new $dir/me/old &lt;BR /&gt;cp $dir/catalina.out $dir/me/new &lt;BR /&gt;diff $dir/me/new $dir/me/old &amp;gt; $dir/me/diffre &lt;BR /&gt;chmod 777 $dir/me/diffre &lt;BR /&gt;grep "no stack trace available" $dir/me/diffre &amp;gt; $dir/me/newfile &lt;BR /&gt; &lt;BR /&gt;By defining PATH local to the script, you don't need fullpaths for the commands. If you are concerned about aliases (ie, alias rm="rm -i") these won't occur in cron because cron does not login. &lt;BR /&gt; &lt;BR /&gt;The set -u is a relaibility control -- it prevent spelling errors from creating problems. If you misspell a variable name and try to use it, the script will create an error message and stop before any damage is done.&lt;BR /&gt; &lt;BR /&gt;I would also change the chmod 777 to a secure value of 644. 777 has two major problems:&lt;BR /&gt; &lt;BR /&gt;1. You are making the diffre file executable and this file is not a program or sctipt. Never add the executable bit to data files.&lt;BR /&gt; &lt;BR /&gt;2. The file is world-writable and therefore can be destroyed by anyone on your system, either by accident or maliciously. 777 (or 666) permissions are red flags that say to the world: "destroy me"&lt;BR /&gt; &lt;BR /&gt;Most new people in Unix see an error like "permision denied" and quickly change the permissions to 777. But when this does not fix the problem, the bad permissions are left and bad things happen. Always determine the real reason for permission problems . Otherwise, your system will become unstable over time.&lt;BR /&gt; &lt;BR /&gt;As far as your cron entry, a * means all occurances (ie, every day, every hour, every minute, etc). If what you want is for the script to run at 2pm and 3pm, then pick which minute you want to run, perhaps 2:10pm and 3:10pm and your cron entry becomes:&lt;BR /&gt; &lt;BR /&gt;10 14,15 * * * /path_to_script/myscript</description>
      <pubDate>Tue, 23 May 2006 08:55:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/crontab-on-solaris/m-p/3792003#M781788</guid>
      <dc:creator>Bill Hassell</dc:creator>
      <dc:date>2006-05-23T08:55:09Z</dc:date>
    </item>
    <item>
      <title>Re: crontab on solaris</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/crontab-on-solaris/m-p/3792004#M781789</link>
      <description>:))&lt;BR /&gt;&lt;BR /&gt;Bill Hassell Thank You very much for your help and time..I do appreciate it..&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;thanks everyone for useful hints..</description>
      <pubDate>Thu, 25 May 2006 06:23:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/crontab-on-solaris/m-p/3792004#M781789</guid>
      <dc:creator>amonamon</dc:creator>
      <dc:date>2006-05-25T06:23:14Z</dc:date>
    </item>
  </channel>
</rss>

