Guest schussat Posted December 10, 2003 Posted December 10, 2003 I'm not sure if "scripting talk" is quite the right place for this one, but I'll try anyway. I'd like to use this php script to automatically update my movabletype comment spam blacklist from the master list hosted by the author of mt-blacklist. The script seems to work when I execute it via the web, but its ideal use is as a cron job. Not thinking through it quite completely, I simply added the script as a cron job to run at midnight, and received the following email from the cron daemon when it attempted to run the script: mt-blacklist-autoupdate.php: line 1: ?php: No such file or directorymt-blacklist-autoupdate.php: line 2: /aquota.user: Permission denied mt-blacklist-autoupdate.php: line 4: mt-blacklist-autoupdate: command not found mt-blacklist-autoupdate.php: line 5: syntax error near unexpected token `newline' mt-blacklist-autoupdate.php: line 5: `Author: Gene Wood <gene_wood@***.net>' I don't think there's any personally-compromising info in that excerpt; I trimmed the script's path, just in case... But it really just consists of the errors that cron gets when it tries to execute the script, line by line, as if it were a shell script -- my bad, it's PHP! Doh! I should have realized that it wouldn't work. So, if I change the cron command to "php /path/to/mt-blacklist-autoupdate.php" will it work correctly? Quote
rklau Posted December 10, 2003 Posted December 10, 2003 Pretty sure that's the trick: if you start the cron job with "php" and then follow it with the absolute path to the script, you're in good shape. Quote
Guest schussat Posted December 11, 2003 Posted December 11, 2003 Yep, t hat did it -- thanks, Rklau! -Alan Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.