Operating System - HP-UX
1823339 Members
3389 Online
109654 Solutions
New Discussion юеВ

Re: cronjob is not running on Sun Solaris

 
SOLVED
Go to solution
crontab is not running
Occasional Advisor

cronjob is not running on Sun Solaris

Hi guys. I am having Sun OS and I want to run cronjob.
1) I created a file named ora10r2 under /var/spool/cron/crontabs/ directory.
In ora10r2 file I am a calling a script called test.sh which runs at 2:55pm.
55 14 * * * /01/mustu/test.sh /u01/mustu/test.log 2>&1

test.sh file exist under /01/mustu and it is having full permission.

but it is not running.

Regards
Musaddaq
8 REPLIES 8
Hein van den Heuvel
Honored Contributor

Re: cronjob is not running on Sun Solaris

So why not simply ask your friendly Sun or Orale support team for help!?

If you want to use this forum, maybe because the hpux folks are nicer? then be sure to look around first.

This question has been asked and answerred many times before:

google: +cron +oracle +site:itrc.hp.com

Make sure that while testing the script starts with a simple echo/print "hello world" to be able to clearly distinguish not-running from not-running-correctly.
Next put an 'env' in there.

:
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=83820
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=106223


Hein.
Patrick Wallek
Honored Contributor

Re: cronjob is not running on Sun Solaris

Did you just manually create the file ora10r2 and then edit it with vi? If so, that won't work. Cron doesn't know anything about the job yet.

Another thing, is ora10r2 an actual user? If not, then it won't work either. Crontab files must be named just like users.

If ora10r2 is a user, then try this:

# su - ora10r2
to become the user.

# crontab -e
to edit the crontab file. Now make sure the job looks right. Now save and quit out of the file.

After that it should run at 14:55 daily.

You may also want to verify the permissions on the ora10r2 file are correct. They should be the same as the other files in the crontab directory.

VK2COT
Honored Contributor

Re: cronjob is not running on Sun Solaris

Hello,

a) Other respondents are right. You do not
add crontab into /var/spool/cron/crontabs directory manually.

It is best to do it via command:

crontab -e

b) In Solaris, you can also use
files to update the cron jobs. For example

crontab /var/tmp/neworacle.txt

When crontab(1) is invoked with filename, it
overwrites an existing crontab entry for the
user that invokes it.

c) Also, make sure that, by any chance,
/etc/cron.d/cron.deny does not list
oracle. Otherwise, you will not be able
to run the jobs.

May 2007 bring peace and good health
to all,

VK2COT
VK2COT - Dusan Baljevic
crontab is not running
Occasional Advisor

Re: cronjob is not running on Sun Solaris

Hi Guys
I tried with crontab -e but instead of file to edit it shows me some number.
and ora10r2 is an oracle user.
and Secondly you are right I created the file in vi editor and then added to crontab.
Some of you ppl are suggesting me to set the Environment how exactly I do that.

Regards
Musaddaq


Sunil Sharma_1
Honored Contributor
Solution

Re: cronjob is not running on Sun Solaris

Musaddaq,

For editing the crontab entries first export the editor

EDITOR=vi
export EDITOR


crontab -e

Sunil
*** Dream as if you'll live forever. Live as if you'll die today ***
D Block 2
Respected Contributor

Re: cronjob is not running on Sun Solaris

let's try this example:

1. su - oracle
2. crontab -l
do you see any entries for this user oracle ?

if not, then you do NOT have an entry or cron entry for this user..

also note: crontab works on user account names.. so study the "cron.allow" file..

search: http://docs.hp.com
and enter string: cron.allow
or string: cron

keep in mind: HP-UX rules, just joking but it's true.
Golf is a Good Walk Spoiled, Mark Twain.
Yogeeraj_1
Honored Contributor

Re: cronjob is not running on Sun Solaris

hi musaddaq,

i would prefer that you first do a:

crontab -l > /tmp/crontab2edit.txt

then edit the file to make appropriate modifications:

vi /tmp/crontab2edit.txt
(or just ftp it to you windows environment to make the modifications and ftp it back)

and finally load it using:
crontab /tmp/crontab2edit.txt


hope this helps!

kind regards
yogeeraj
No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)
crontab is not running
Occasional Advisor

Re: cronjob is not running on Sun Solaris

Hi Guys
Thamks a lot for ur response. Cronjob is working fine now.
Have a gr8 day.
Regards
Musaddaq