crontab doesn't work, but everything is set correctly
Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Here is an example of my crontab file to send an email of my ~/tmp directory to my email everday at 5:10pm. Make sure your using 24hr time. cron seems correct just test the program path before adding to crontab.
Originally posted by kencaz Here is an example of my crontab file to send an email of my ~/tmp directory to my email everday at 5:10pm. Make sure your using 24hr time. cron seems correct just test the program path before adding to crontab.
1: Is the cron daemon running?
2: What does your system log say? It's probably got tons of crap in there... try to grep out your script name in the system log.
3: Remember that cron will have a different environment than you, or even the "at -f" command. It's very likely it's running, but something isn't working right.
Also, the easy way to find out if cron is running is to follow IBall's advice with a cheesy little script.
Last edited by GaijinPunch; 06-16-2005 at 01:15 AM.
Distribution: OpenBSD, Solaris, Red Hat, Ubuntu, OS X, HP-UX, Tru64
You could mod the script so you get output then change the start times to be every minute or every 5 minutes. Redirect the output to /tmp/output. It doesn't guarentee that it'll work at the specified times, but you'll know you don't have a problem with the script or a default environment issue.
the prog i was trying to run is really a script that uses java at one point. But since crontab just spawns a new job to handle the program, without setting up the environment in any way, the PATH wasn't set correctly and java wasn't been able to run.
The solution was to do:
xx xx * * mon-fri bash -l bla
so that i run bash in login mode and the environment gets setup correctly.