Crontab calling php script

Hi there..

Just trying to figure out how to get a crontab to call a php script.

??

Should I be doing something else instead? I’m new to cron jobs, always just used Task Manager.

Thanks

[QUOTE=Xoltaric]
Hi there..

Just trying to figure out how to get a crontab to call a php script.

??

Should I be doing something else instead? I’m new to cron jobs, always just used Task Manager.

Thanks
[/QUOTE]

I tried

/hsphere/local/home/username/subdomain.jodohost.com/directory/scripttorun.php

But I got…

/bin/sh:
/hsphere/local/home/username/subdomain.jodohost.com/directory/scripttorun.php: Permission denied

Hmmmm…?

Are you trying this on a linux account?

[QUOTE=Yash]
Are you trying this on a linux account?
[/QUOTE]

Yes.

You’ll need some basic knowledge of unix shell commands. A tutorial should be available for that somewhere on the Internet. Here’s some information how to use crontab:

http://www.jodohost.com/hsphere/direct_access_to_server.html

[QUOTE=Yash]
You’ll need some basic knowledge of unix shell commands. A tutorial should be available for that somewhere on the Internet. Here’s some information how to use crontab:

http://www.jodohost.com/hsphere/direct_access_to_server.html
[/QUOTE]

Ok.. I think I understand. I have to use PHP in CLI mode… so I have to first establish php as the interpreter. For that I need the path to php on the server…

?

Right now I think it is trying to run my php as shell commands.

Re: Re: Crontab calling php script

[QUOTE=Xoltaric]
Ok.. I think I understand. I have to use PHP in CLI mode… so I have to first establish php as the interpreter. For that I need the path to php on the server…

?

Right now I think it is trying to run my php as shell commands.
[/QUOTE]

Well that didn’t work…

But.. this does…

wget http://www.mysite.com/dir/mycronfile.php

Woo hoo.

After taking ages to work out the crontab is under “FTP/User Account” > FTP User I have the following problem..

Everytime the cronjob is executed it writes a file to my user directory, with an incrementing file extension (so .1, .2, .3 … .39483) and show no signs of stopping.

Example of the command im running is:
/bin/sh: wget -q http://bla.website.bla/cron.php > /dev/null

Does anyone else have this problem?
Any advice?

Cheers,
Gareth

Please send us the ticket with domain name.