Operating System - HP-UX
1834802 Members
2382 Online
110070 Solutions
New Discussion

Re: How to start a cron Job ?

 
ng_7
Regular Advisor

How to start a cron Job ?

Hi, My dear friends,

I having some problem on my cron job, the cron not start eventhough i already perform /sbin/init.d/./cron start , please see below

app:/sbin/init.d# ./cron start
cron started
tamcoapp:/sbin/init.d# ! cron is already running Fri Jul 27 16:29:35 mal 2007
! ******* CRON ABORTED ******** Fri Jul 27 16:29:35 mal 2007

my schdule detail as per below :
33 16 * * 5 /home/applprod/scripts/sh appl.sh

and my appl.sh detail is as below :
echo "Copy APPL_TOP file Start on `date`" >> /home/applprod/tarbk.log
cd /prod/applprod/prodora/8.0.6
cp -R . /u01/alson
echo "Finished copy APPL file on `date`" >> /home/applprod/tarbk.log

Note : My server time is correct, and Malaysia day is Friday.

Please advise. thanks
1 REPLY 1
Yogeeraj_1
Honored Contributor

Re: How to start a cron Job ?

hi,

Normally, you do not need to start cron each and every time.


If you run the following successfully then your cron is OK!

# ps -ef|grep cron
root 2023 1 0 Jun 9 ? 0:09 /usr/sbin/cron
#

Now, try to modify your script and crontab as follows:

appl.sh
========
#!/sbin/sh
echo "Copy APPL_TOP file Start on `date`" >> /home/applprod/tarbk.log
cd /prod/applprod/prodora/8.0.6
cp -R . /u01/alson
echo "Finished copy APPL file on `date`" >> /home/applprod/tarbk.log


Crontab
=======

#*******************************************************************************
# min|hour |day |month|day |script
# | |of mo| |of wk|
#----|-----|-----|-----|-----|--------------------------------------------------
#*******************************************************************************
33 16 * * 5 /home/applprod/scripts/appl.sh 1>/home/applprod/scripts/output-appl.crn 2>/home/applprod/scripts/error-appl.crn
#*******************************************************************************
# END OF TABLE day0->Sunday day6->Saturday
#*******************************************************************************

revert!

kind regards
yogeeraj

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