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

CRON not running?

Status
Not open for further replies.

Stinney

IS-IT--Management
Nov 29, 2004
2,031
US
I created a script and executed crontab -e which I understand edits the crontab file for the user that is currently active. However, the script did not execute.

Here is an output of the crontab file:

0,30 * * * * /export/home/ahupper/loggedin.sh > /dev/null 2>&1

This should run the file loggedin.sh every 1/2 hour correct?

Is there something I need to do to activate the crontab for this user?

- Stinney

Favorite all too common vendor responses: "We've never seen this issue before." AND "No one's ever wanted to use it like that before.
 
There could be a number of things wrong. Here are a few that spring to mind.

- check the cron daemon is running (ps -ef | grep cron)
- check 'execute' permission is on the script (ls -al export/home/ahupper/loggedin.sh)
- instead of running the script ... > /dev/null 2>&1 try ... > /tmp/loggedin.out 2>&1 (this may provide errors that you can debug, eg $PATH not set up correctly)

I hope that helps.

Mike
 
1) shows running:

root 216 1 0 Oct 27 ? 0:34 /usr/sbin/cron

2) script is executable, runs if I invoke manually

3) where can I see the output of the log?

- Stinney

Favorite all too common vendor responses: "We've never seen this issue before." AND "No one's ever wanted to use it like that before.
 

*Brain Fart*

Path in the crontab was wrong, fixed it, working great.

- Stinney

Favorite all too common vendor responses: "We've never seen this issue before." AND "No one's ever wanted to use it like that before.
 
3) where can I see the output of the log?

You can't. Because you ran the script (from cron) ... > /dev/null 2>&1

which sends all output to /dev/null and any error messages to the same place. (hence my third suggestion above).

I hope that helps.

Mike
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top