HPE Community read-only access December 15, 2018
This is a maintenance upgrade. You will be able to read articles and posts, but not post or reply.
Hours:
Dec 15, 4:00 am to 10:00 am UTC
Dec 14, 10:00 pm CST to Dec 15, 4:00 am CST
Dec 14, 8:00 pm PST to Dec 15, 2:00 am PST
cancel
Showing results for 
Search instead for 
Did you mean: 

CRON JOB PROBLEM

 
SOLVED
Go to solution
HP UNIX Professionals
Frequent Advisor

CRON JOB PROBLEM

Hi Experts

I have problem in corn jobs,

1. when i check the corn jobs by "ps -ef | grep corn" Getting Outpur such as

BCCIB30:/ # ps -ef | grep cron
root 528 28967 1 15:51:14 pts/2 0:00 grep cron
root 15350 1 0 15:34:18 ? 0:00 cron start

2.When i am starting the cron jobs by"cront start" command


I am getting error like and page is hanging

BCCIB30:/sbin/init.d # ! cron is already running Mon Apr 26 15:45:47 EDT 2010
! ******* CRON ABORTED ******** Mon Apr 26 15:45:47 EDT 2010


Please veryfy the following output and guid me to start the corn job




Thanks & Regards,

Vinay
5 REPLIES
Patrick Wallek
Honored Contributor
Solution

Re: CRON JOB PROBLEM

It looks like the cron daemon is not running correctly.

When you do a 'ps -ef |grep cron' you should get something like this:

# ps â ef | grep cron
root 2773 1 0 Apr 8 ? 0:03 /usr/sbin/cron


Try stopping and restarting cron itself:

# /sbin/init.d/cron stop

See if the is still a 'cron start' running. If so, kill it.
# ps -ef |grep cron

Once there are no cron daemons running, try starting cron.

# /sbin/init.d/cron start

Now see what is running again. If you see 'cron start' then something is wrong. Check the various log files (/var/adm/syslog/syslog.log, /etc/rc.log, /var/adm/cron/log) and see if there are errors.

If you see '/usr/bin/cron' as above then it should be OK again.
Steven E. Protter
Exalted Contributor

Re: CRON JOB PROBLEM

Shalom Vinay,

If the problem persists, you may need to copy /sbin/init.d/cron from a HP-UX system that is working right.

The startup script itself might be damaged.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
James R. Ferguson
Acclaimed Contributor

Re: CRON JOB PROBLEM

Hi Vinay:

> When i am starting the cron jobs by"cront start" command

Are you actually doing:

# cron start

...when you mean to re-configure 'cron' to use a new 'crontab'?

Do you thus, mean:

# crontab file

A better way (than 'grep'ping the process table) to find the running 'cron' daemon (if any) is:

# UNIX95= ps -C cron -opid,comm,args

...which should yield something like:

PID COMMAND COMMAND
1555 cron /usr/sbin/cron

...if the 'cron' daemon is running.

Regards!

...JRF...


Regards!

...JRF...

Kapil Jha
Honored Contributor

Re: CRON JOB PROBLEM

I think somebody tried to start cron as
#cron start

you should try to kill it and just run
#/usr/sbin/cron

BR,
Kapil+
I am in this small bowl, I wane see the real world......
Raj Briden
Frequent Advisor

Re: CRON JOB PROBLEM

i think restarting cron would work

You may submitting the cron job incorrectly if you do so by
placing root's cron file directly in /var/spool/cron/crontabs.
Instead, you should always use the crontab command to manipulate
cron jobs. Do not manually submit jobs by editing files or
adding files to /var/spool/cron/crontabs/. Use the crontab
command to do that work for you.

Execute the following as root in order to clear up the problem:

1) Normally, you would use crontab to modify an existing
cron schedule, but since you previously tried to set up your
cron jobs by moving a file into /var/spool/cron/crontabs,
start by moving that file to a workfile:
mv /var/spool/cron/crontabs/root /tmp/cronfile
2) cd /tmp
3) crontab cronfile

If this does not resolve the problem, then try killing and restarting
the cron(1M) daemon.

Please note that once you have a working cron configuration, and wish
to change the schedule or add/delete cron jobs, then you use crontab(1)
and not cp(1)/mv(1). Please note that you must be signed on as the
specific user whose cron jobs you are trying to modify. Here are some
typical commands to use:

- To list your current set of cron jobs:
crontab -l

- To list your current set of cron jobs to a file named cronfile
that can been modified:
crontab -l > cronfile

- To submit a crontab file to cron:
crontab cronfile

- To edit a previously submitted crontab file:
crontab -e

- To remove all cron jobs:
crontab -r