Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Cron entry not getting picked up

Status
Not open for further replies.

nkm

Programmer
May 27, 2001
45
US
Hi

I am using HP-UX 10.20. I have made some entries in the cron file using the crontab -e. the entry is not getting scheduled.

Am I doing somthing wrong ?
Apart from having an entry in cron.allow is there some other prerequisite for cron ?

thanks!

 
what entry have you made , when doing crontab -e ?
After you edit crontab using crontab -e , do you save
the entry .
does crontab -l ( show your entry )?
Do you other cron entries work ?
Have you tried stop and starting cron ?
/sbin/init.d/cron stop
/sbin/init.d/cron start

Could the cronjob have ran , but there are errors in the script you run ? check roots mail ( mailx) to see if there are any mail files at the time you run your job ?

HTH
 
Also remember that cron does not inherit any environment variables - you may have to define these explicitly within the script. HTH.
 
Hi

I have just one entry in the cron file

* * * * * echo &quot;hello&quot; > <file>

crontab -l does show this entry

But it is never executed. Does an entry into the crontab file (or when the file gets created) require a restart of the cron daemon.

I am not having root permissions so I cannot stop and start the cron.

thanks!!


 
crontab -e and then a :wq (as in vi) will make sure that cron knows the entry is there. HTH.
 
Have a look in /var/adm/cron/log file
tail the file tail log and have a look at the time stamp of when the last cron job ran ( or for any errors)
if the time is not recent , try stopping and restart the cron daemon as the root user.
 
You have a major problem here.
you are running echo &quot;Hello&quot; > file every hour every second.
So even if your cron job is running you will not know because this command will wipe out anything in file again and again.

run it as
* * * * * echo &quot;Hello&quot; >> file

Remember this will going to fill up your disk.

For more accurect testing run

0,10,20,40,50 * * * * date >> file


Patel

 
I know if there are multiple PATHs (and at times, different behaviors) for a single command, e.g., shutdown, I have had to fully qualify the PATH in the crontab, e.g., &quot;/usr/sbin/shutdown&quot; vs. &quot;/bin/shutdown&quot; . Something to chew on.

radbam
 
Hi

Its been figured out.
The problem required a cron restart, which has been fixed in one of the patches by HP.

thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top