Jump to content

Recommended Posts

Posted

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

Posted

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?

 

Posted

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

Posted

The reason that doesn't work is because it's not a command. Your command must be a valid UNIX-type shell command.

Posted

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.

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...