1833467 Members
2831 Online
110052 Solutions
New Discussion

Cron Job

 
SOLVED
Go to solution
mehul_3
Regular Advisor

Cron Job

I would like to cron a job say /home/oracle/shutdown.sql after every two days.I am aware of the format but I am going to implement it on first time.

Pl. guide me in this regard.

Regards,
Mehul


6 REPLIES 6
Yogeeraj_1
Honored Contributor
Solution

Re: Cron Job

hi,

Attached a typical format that i am used to.

hope this helps!
regards
yogeeraj
No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)
Yogeeraj_1
Honored Contributor

Re: Cron Job

hi again,

sorry forgot the attachment.

note that i am here using root user to schedule the job using cron, you can alternatively use the Oracle User itself.

if you need any further hep, let us know.

regards
yogeeraj
No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)
Yogeeraj_1
Honored Contributor

Re: Cron Job

hi,

if you need additional help on how to configure or give appropriate permissions for cron, please refer to the following url:
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=939316

or man crontab

regards
yogeeraj
No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)
Muthukumar_5
Honored Contributor

Re: Cron Job

You can try as,

# Minue Hour monthday month weekday
30 12 * * * /home/oracle/shutdown.sql 1>/dev/null 2>&1

If /home/oracle/shutdown.sql is a shell script then put code in the begin as,

if [[ $((`date +'%m'`%2)) -ne 0 ]]
then
echo "No need to execute it
exit 0
fi

else put this in a script and execute /home/oracle/shutdown.sql from this script.

hth.
Easy to suggest when don't know about the problem!
Arturo Galbiati
Esteemed Contributor

Re: Cron Job

You can type 'man crontab' to see usage and parameter.

Art
Himanshu_3
Valued Contributor

Re: Cron Job

Mehul,

The below may help you as well

# 00 00 * * * /usr/local/scripts/cronscript
# | | | | | |
# | | | | | script to run
# | | | | +---------- month
# | | | +------------ day
# | | +-------------- day of the week 0-6, 0 = sunday, 1-5 = mon to fri
# | +----------------- hour of the day 00 to 23
# +-------------------- minute 00 to 59


Rgds,
Himanshu