iLLeLogicaL Posted June 22, 2007 Posted June 22, 2007 Hi, I just got a question on how to setup cron jobs: Let's say: I got a file named clean.php in my public_html folder, and I want that file to be executed every hour (every day, every week, every month --> I can do this) What should the command then be (using the standard version of the cronjob in the Cpanel)? -- iLLeLogicaL -- Quote
Ashoat Posted June 23, 2007 Posted June 23, 2007 http://www.google.com/search?sourceid=navc...amp;q=cron+jobs Quote
iLLeLogicaL Posted June 23, 2007 Author Posted June 23, 2007 Now that isn't very helpfull since I googled for it already to many times, and I get some stupid errors! Should I change permissions maybe ? It seems that the corntab DOESN'T recognize php, I always get the error on line 1: ?php no such file or directory How the heck do I tell the crontab to execute php? Quote
iLLeLogicaL Posted June 23, 2007 Author Posted June 23, 2007 /home/julius/public_html/bot.php Generates this output: /home/julius/public_html/bot.php: line 1: ?php: No such file or directory /home/julius/public_html/bot.php: line 2: syntax error near unexpected token `"file_name.php"' /home/julius/public_html/bot.php: line 2: `include_once("file_name.php");' Quote
Ashoat Posted June 24, 2007 Posted June 24, 2007 The reason that doesn't work is because it's not a command. Your command must be a valid UNIX-type shell command. Quote
iLLeLogicaL Posted June 24, 2007 Author Posted June 24, 2007 Well since I don't know UNIX-shell commands, can you tell me what it should be so it executes bot.php in directory /home/julius/public_html/ ? Quote
Quantum Media LLC Posted June 24, 2007 Posted June 24, 2007 Here are some links i found for you http://forums.devshed.com/unix-help-35/exe...int-202007.html here is the google link list for the search i did http://www.google.com/search?q=execute+a+p...amp;startPage=1 Quote
Ashoat Posted June 25, 2007 Posted June 25, 2007 Using Google isn't that hard If you don't know what cron is or how to setup cron, you've got to be really careful using it. Cron is the most dangerous feature we offer, and its taken our servers down a few times. DO NOT EXECUTE YOUR COMMAND MORE THAN ONCE EVERY HOUR. Once again, be really careful. 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.