Jump to content


Photo

Cron Job (Command Line) *SOLVED*


  • Please log in to reply
3 replies to this topic

#1 pocobueno1388

pocobueno1388
  • Members
  • PipPipPip
  • Advanced Member
  • 3,369 posts
  • LocationPalm Beach, Florida

Posted 15 October 2006 - 04:42 AM

I am hosted with hostgator.com and can't figure out how to get a cron job to work. I am doing it the 'standard' say since I am not advanced at it. It is telling me to enter a "Command to run"...I have no idea what to enter in this. I have tried a couple of different things but nothing seems to work.

I think I only need the path of the file...not 'when' I want it to run. Because below where I enter the command line if gives me choices on if I want to run it every hour, day, month, etc.

I have copied and pasted an example path and replaced all the info with mine, but still couldn't get it to work. The scripts name that I am trying to run is called 'cron.php' and it is in a folder called 'public_html'.

How would I make a command line or path to that file? If I left anything out, just let me know. Thanks guys =)



#2 trq

trq
  • Staff Alumni
  • Advanced Member
  • 31,041 posts

Posted 15 October 2006 - 06:24 AM

How would I make a command line or path to that file?


This really depends on where your script is in relation to root. Something like....

php /home/username/public_html/cron.php

may come close but really, your host should provide better docs. You may also need to put a shebang in the script to let the server know what to run the script with. eg;

#!/usr/bin/php
<?php
  // script here
?>
[/code]

#3 pocobueno1388

pocobueno1388
  • Members
  • PipPipPip
  • Advanced Member
  • 3,369 posts
  • LocationPalm Beach, Florida

Posted 15 October 2006 - 06:34 AM

Eh, it isn't really a script I need to insert into a code...the server should take care of everything if I enter the path or command line.

I tried:
php /home/username/public_html/cron.php

Nothing happened.



#4 pocobueno1388

pocobueno1388
  • Members
  • PipPipPip
  • Advanced Member
  • 3,369 posts
  • LocationPalm Beach, Florida

Posted 15 October 2006 - 06:35 AM

Nevermind, it worked! Thank you so much.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users