1826216 Members
2809 Online
109691 Solutions
New Discussion

cronjob is not running

 
yogesh kumar_2
Frequent Advisor

cronjob is not running

Hi

I want to schedule cronjobs for backup scripts.I schedule it but it is not running.I have cron.deny empty.
22 REPLIES 22
Deepak Kr
Respected Contributor

Re: cronjob is not running

yogesh,

how r u adding script to cron here?
what is there is cron.allow file ?
you need to add user id in cron.allow first
switch to that user
set editor to vi (export EDITOR=vi)
run crontab -e
update/save and close

"There is always some scope for improvement"
Deepak Kr
Respected Contributor

Re: cronjob is not running

if cron.allow exists and you dont have entry in cron.allow while cron.deny is empy cron job will not run.

if cron.allow exists then you better add userid into this file using vi

also check if cron process is active

ps -ef|grep cron |grep -v grep
"There is always some scope for improvement"
prasadb
Super Advisor

Re: cronjob is not running

hi yogesh,

if your cronn.deny is empty and cron.allow is does not exist, In this
case, all users of the system are granted cron access.so be careful of this situation.

>>.I schedule it but it is not running

try stopping the cron damaen and then start it again,

/usr/sbin/cron stop
/usr/sbin/cron start

check then by ps -ef|grep con


prasadb
Super Advisor

Re: cronjob is not running

hi yogesh,

i am attaching a file for various options and combination for cron.allow and cron.deny. Go thru it and check your file according to that ..

yogesh kumar_2
Frequent Advisor

Re: cronjob is not running

Hi prasadb,

What u have answered the same problem i have but usr/sbin/cron start is not available.
Dennis Handly
Acclaimed Contributor

Re: cronjob is not running

>but /usr/sbin/cron start is not available.

As documented in cron(1M), that should be: /sbin/init.d/cron
SKR_1
Trusted Contributor

Re: cronjob is not running

check with

ps -ef | grep cron

/sbin/init.d/cron status
/sbin/init.d/cron stop
/sbin/init.d/cron start

Check for onwer of the cron job in cron.allow file

You can edit crontab

crontab -e

Thanks

SKR
yogesh kumar_2
Frequent Advisor

Re: cronjob is not running

hi
In sbin /init.d is not available.
Dennis Handly
Acclaimed Contributor

Re: cronjob is not running

>In sbin /init.d is not available.

What does this show:
ll /sbin/init.d/cron
ls /sbin/init.d/ | wc

This file is part of:
OS-Core.UX-CORE: /sbin/init.d/cron
PHCO_32371.UX-CORE: /sbin/init.d/cron
Patrick Wallek
Honored Contributor

Re: cronjob is not running

Is this actually HP-UX, then? Or is it some other variety of Unix/Linux?

Do you have anything in /etc/init.d perhaps?

# ls -l /etc/init.d/cron*

yogesh kumar_2
Frequent Advisor

Re: cronjob is not running

hi

i have /etc/init.d/crond
Dennis Handly
Acclaimed Contributor

Re: cronjob is not running

As mentioned by Patrick, what does "uname -a" show?
You are either on some foreign devil OS, or on 9.x?
Patrick Wallek
Honored Contributor

Re: cronjob is not running

OK, then try:

# /etc/init.d/crond start

If it says something about already started, then try:

# /etc/init.d/crond stop

# ps -ef |grep cron
If there are still cron processes, kill them.

# /etc/init.d/crond start


If this happens to be a LINUX server of some variety, then you can try:

# rccrond start

or if cron is already running

# rccrond restart
yogesh kumar_2
Frequent Advisor

Re: cronjob is not running

Its a LINUX m/c
Patrick Wallek
Honored Contributor

Re: cronjob is not running

That would have good to know from the beginning.

Since you didn't mention that to start with everyone here kind of assumed it was HP-UX, since your question was posted in the HP-UX forum.

Since it is Linux, see my post above and see if any of it works.
yogesh kumar_2
Frequent Advisor

Re: cronjob is not running

hi how to run its saying wrong command.
pls tell me in stepwise.
Patrick Wallek
Honored Contributor

Re: cronjob is not running

Without seeing EXACTLY what you are doing, it is hard to tell.

WHAT is saying "wrong command"? Can you cut-and-paste the EXACT commands and errors you are getting?
Deepak Kr
Respected Contributor

Re: cronjob is not running

Yogesh,

First things is that you should always tell OS coorectly before you give other details as this ease the work here to help you further.

Never mind, can you provide us following:

#uname -a
#ls -ltr /etc/init.d/*cron*

To manage crond daemon in Linux, we can make use of â serviceâ command.

To check the status of crond daemon:

service crond status

To stop and terminate crond process:

service crond stop

To start and run crond daemon:

service crond start

To restart crond service:

service crond restart
"There is always some scope for improvement"
Deepak Kr
Respected Contributor

Re: cronjob is not running

also:
To restart the cron service, use:
# /etc/init.d/crond restart
"There is always some scope for improvement"
Dennis Handly
Acclaimed Contributor

Re: cronjob is not running

I've asked the moderators to move this to linux.

I noticed that you have never assigned any points: 0 of 30 responses
http://forums.itrc.hp.com/service/forums/pageList.do?forumId=1&listType=unassigned&userId=WW76047

Please read the following about assigning points:
http://forums.itrc.hp.com/service/forums/helptips.do?#33
If you don't assign points, eventually nobody will provide answers.
yogesh kumar_2
Frequent Advisor

Re: cronjob is not running

Hi Deepak,

uname -a = LINUX
ls -ltr /etc/init.d/*cron
= /etc/int.d/anacron

The above replies are shown in my LINUX workstation
yogesh kumar_2
Frequent Advisor

Re: cronjob is not running

Hi Deepak,

uname -a = LINUX
ls -ltr /etc/init.d/*cron
= /etc/int.d/anacron, /etc/init.d/crond