Discussion Locked

Crontab

0 helpful
7 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

i have 2 sun server running squid program.
i am using crontab to clear my cache server.

every 50 min

50 * * * * /myclearcache files

The first server is running smoothly
the second one not running..why??

i have ps -ef and check...both cron is running.

Can tell me wht exactly is the problem??

7 replies

by joematus

Your job is not running every 50 minutes it's running every hour when the clock hits 50 minutes after the hour. It's hard to tell what's going on without seeing the script "myclearcache files". What happens when you run the job manually from the command line? If it fails, that may give you clue as to what happened. Also check the mail of the user that runs the cron job with the mail command. The system usually will mail the user with an error messages of a cron job that failed. Another thing to check is the cron log. In solaris it's located in the file /var/cron/log -- see if there's anything in there.

by jaboy78

Thanks for the cron log...the error is root ..no such user...but i have tht user...why is there still got this error??

If u solve my problem..i will give u the rate..
thanks

by ghislain.levesque

Is the perm on your script avec execute permission? Redirect the output in your crontab

50 * * * * /myclearcache files > /tmp/result.dat 2>&1

try to run it when login. You could use sh -x myclearcache files to see what's happening.

When it's running from the cron, is your PATH setup correctly...

It's hard to tell without knowing what the script is doing....

Good luck.

This discussion is closed to new replies.