|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
Crontab not working
Here
crontab -e: 30 18 * * * php bookproxy/followup.php 30 18 * * * php bookproxy/expire_needers.php Well? Those scripts aren't executing at 6 30 PM or ever. |
|
#2
|
||||
|
||||
|
Quote:
doing 'man crontab' yields: Quote:
check your path(s) [both php and its arguments] are accessible from cron. If not provide ABSOLUTE pathnames and/or "source" your profile. |
|
#3
|
|||
|
|||
|
Quote:
Hello and thank you for replying. I read the man page but Echoing $HOME gives me the existing directory, which I am able to execute PHP from the shell. Echoing $PATH results: /usr/local/bin:/usr/bin:/usr/X11R6/bin:/bin:/usr/local/msql/bin:/usr/local/mysql-3.21.29-gamma/bin:/usr/games:. I assumed that since I was able to execute PHP from my home directory, cron would be able to. Any idea? |
|
#4
|
||||
|
||||
|
Quote:
you executed 'php' from the shell prompt. cron's PATH is different also 'bookproxy/followup.php' and 'bookproxy/expire_needers.php' are RELATIVE paths. Relative to what? I'd consider supply ABSOLUTE pathnames anywhere in cron AND/OR explicitely "sourcing" your user "profile" from cron as well. Something like this - with mnemonic pathnames: Quote:
|
|
#5
|
|||
|
|||
|
Quote:
Thank you for the example but I have some questions. Firstly, I do not have .profile, at least not in the home directory. What should be in there, to be sourced? The paths are relative to $HOME. Is this neccessary to put before the relative paths of those .php docs? |
|
#6
|
||||
|
||||
|
Quote:
what shell are you using? csh/tcsh/bash??? do you have '.cshrc'? these are the shell 'startup' files that set your environment. Quote:
yes. try debugging your cron entry like so: Code:
30 18 * * * [ -f $HOME/.profile ] && . $HOME/.profile && /path2php/php /path2book/bookproxy/followup.php > /tmp/cron.log 2>&1 check '/tmp/cron.log' AFTER the cron entry is to be executed. |
|
#7
|
|||
|
|||
|
Crontab now contains:
Quote:
Yet at 10:58 nothing happened (no output to log). Checked the system time with 'date' just to make sure. |
|
#8
|
|||
|
|||
|
wondering if ANYTHING gets executed from your cron.
debug it one step at the time: 58 10 * * * /bin/ls $HOME > /tmp/cron then try: 58 10 * * * [ -f $HOME/.bash_profile ] && $HOME/.bash_profile && /bin/ls $HOME > /tmp/cron also read 'man crontab': Quote:
|
|
#9
|
|||
|
|||
|
Quote:
No response. I am going to mail the sysadmin. Will let you know if that doesn't fix things, thank you very much for your help and patience! |
![]() |
| Viewing: Dev Shed Forums > Operating Systems > UNIX Help > Crontab not working |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|