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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

crontab not executing commands

Status
Not open for further replies.

tekpr00

IS-IT--Management
Jan 22, 2008
186
CA
hello All:

I recently deleted my crontab by mistake. Instead of crontab -l I mistakenly issued crontab -r.

I got the liunux backup group to restore the file. Now I can issue crontab -l and see the crontab.

However, all the commands in the crontab is not executing. here are the files in /var/spool/cron/crontabs:

-rw------- 1 root other 720 Jun 8 2005 sys
-r-------- 1 root netcon 49 Jun 22 2005 netcon.au
-r-------- 1 root root 47 Oct 3 2005 adm.au
-rw------- 1 root root 780 Oct 3 2005 adm
-r-------- 1 root root 54 Oct 23 2008 root.au
-rw------- 1 root root 1605 Oct 23 2008 root
-r-------- 1 root dba 56 Dec 31 12:56 oracle.au
-rw------- 1 root dba 1321 Dec 31 12:56 oracle


Here is a sample of commands in my crontab:
35 12 * * * . /etc/profile; . $HOME/.profile; /export/home/oracle/scripts/sysmntr/stmt.sh > /dev/null 2>&1
 
try a dummy edit of the crontab file

[tt]crontab -e[/tt]
==> now make a meaningless change in the file - add a space somewhere - save and close your editor, this should instruct cron to re-read your crontab commands

OR

[tt]crontab -l >/tmp/mycrontab
crontab /tmp/mycrontab[/tt]

HTH,

p5wizard
 
Hi

What I would do if p5wizard's hints are not enough :
[ul]
[li]Check if [tt]crond[/tt] is running and is still responsive.[/li]
[li]Check the permission of the involved files.[/li]
[li]Remove the tasks output redirection then check my mail after the tasks should be run. ( Or redirect them into files then check those files. )[/li]
[li]Check the running processes to see if previously started tasks were finished.[/li]
[li]Check the log files.[/li]
[li]Check the system's load and the [tt]cron[/tt] settings, if your [tt]cron[/tt] is able to delay the tasks when heavy system load is detected.[/li]
[/ul]


Feherke.
 
thanks all the crontab is now working.

All I did is remove the crontab on purpoes this time and re-create it.

Again, thanks all
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top