Web Hosting Talk







View Full Version : Cron Jobs


Ernestaz
10-01-2006, 07:26 PM
Hi,

I don't know anything about cron jobs... I have a .php script, that needs to be launched every hour. The scripts is located at /home/users/hosting/system/bizare.php

What should I enter in CPanel Cron Jobs section "Comand to run", to launch this script?

submenu
10-01-2006, 09:57 PM
Depends on how you need to run the script for it to work. You can use this command:

php /home/users/hosting/system/bizare.php > /dev/null

Which will run it through the command line interface. Or you can use:

GET http://www.domain.com/system/bizare.php > /dev/null

Which will run it through http.

Ernestaz
10-02-2006, 12:37 AM
Thanks Mark, you helped me alot!

mikey1090
10-02-2006, 02:58 AM
what is the difference between the two?

submenu
10-03-2006, 12:48 AM
Ernestaz: Your welcome :)

mikey1090: running it through CLI will mean no $_SESSION or $_SERVER variables. Normally this shouldn't make a difference though

Wildhalf
10-03-2006, 06:32 AM
Hi,

I need help with creating a remote cron job. I stupidly joined GoDaddy and now need to run 2 or 3 cron jobs foir different scripts i have installed.

I have a friend on ipower who is willing to create one on his server for me.

I assume all i have to do is create a PHP script, that calls the php scripts that i need ran place it on his server and create a cron job calling this php script on his server.

Which of the above posted by submenu would be best to use??


Am i right here or what will i need to do??

Also have you any advice on which hosting provider is best for running CRON jobs??

Thanks in advance for your help

Kieron

mikey1090
10-03-2006, 08:27 AM
most hosting pviders have cPanel - a very popular control panel. so most hosts have the same cron job managers. correct me if i am wrong

HC-Sam
10-04-2006, 03:39 AM
Yeah, cPanel makes it very easy to create and configure cron jobs. You can edit the commands, the time, and everything in a snap. Also, you can edit them in SSH if you have root access.

ngsupb
10-04-2006, 01:09 PM
Wildhalf,

cron is a standard linux feature. There are no best or bad hosting providers for cron.
They just provide you with it or not (through the web interface or ssh)

Regarding your script and what you need to do:
1) put a script on your server and make it available through the web, something
like http://your_domian.com/script.php
2) ask your friend to set up in cron the command:
wget --spider http://your_domian.com/script.php
or
GET http://your_domian.com/script.php

it is done:) nothing more.