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 --
Ashoat Posted June 23, 2007 Posted June 23, 2007 http://www.google.com/search?sourceid=navc...amp;q=cron+jobs
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?
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");'
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.
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/ ?
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
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.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now