Jump to content

Setting up cronjobs


Recommended Posts



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 --

Link to comment
Share on other sites

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?


Link to comment
Share on other sites


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");'

Link to comment
Share on other sites

Using Google isn't that hard :P

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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...