Go Back   HostGator Peer Support Forums > Public Forums > Pre-Sales Questions

Notices

Reply
 
Thread Tools
  #1  
Old 11-30-2005, 07:33 AM
Unregistered
HostGator Guest
 
Posts: n/a
Default Cron jobs in cpanel - Help

Hi,

I have a shared account and want to set up a cron job to run a script once a day.

Way I understand it, you go to cpanel > Cron jobs > Standard and then choose the times you want.

My question is, what do I put into the box labelled 'Command to run'? Do I just put in the path to the script I want to run, like this?

http://www.mydomain.com/directory/scriptname.php

Or is it something else altogether?

I know zip about unix, linux, C, php and anything else you care to mention!

Your help is much appreciated!

Best regards,
Jill
Reply With Quote
  #2  
Old 11-30-2005, 08:17 AM
twisty twisty is offline
Baby Croc
 
Join Date: Nov 2005
Posts: 50
Default Re: Cron jobs in cpanel - Help

For PHP scripts, like this:

/usr/bin/php /home/useraccount/public_html/example.php

Thus, your script is called and run via the PHP interpreter (/usr/bin/php)

Note: Don't use URL's with this method, only paths.

Reply With Quote
  #3  
Old 11-30-2005, 08:17 AM
amartins's Avatar
amartins amartins is offline
Royal Croc
 
Join Date: Dec 2003
Location: Europe
Posts: 415
Default Re: Cron jobs in cpanel - Help

I guess it will depend on the script so u should read the instructions anyway either php -q /path/script.php or usr/bin/GET http://site.com/script.php

Antonio.
Reply With Quote
  #4  
Old 11-30-2005, 09:46 AM
Unregistered
HostGator Guest
 
Posts: n/a
Default Re: Cron jobs in cpanel - Help

Hi guys,

Thanks for your replies! I'll try out your suggestions.

Regards,
Jill
Reply With Quote
  #5  
Old 11-02-2007, 03:34 PM
stlewis stlewis is offline
Hatchling Croc
 
Join Date: Nov 2007
Posts: 1
Default Re: Cron jobs in cpanel - Help

Because this topic was left with a bit of a cliffhanger as to whether either suggestion actually worked, I wanted to say that Twisty's suggestion worked perfectly for me after an hour of messing around with other methods.
Reply With Quote
  #6  
Old 01-04-2008, 03:38 PM
calum's Avatar
calum calum is offline
Swamp Croc
 
Join Date: Jun 2007
Location: Aberdeen, Scotland
Posts: 326
Default Re: Cron jobs in cpanel - Help

Or you can visit it with a web browser like lynx:

lynx -dump http://www.yoursite.com/cron.php

But the result is the same.
Reply With Quote
Reply

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

All times are GMT -6. The time now is 12:15 AM.

 
Forum SEO by Zoints