pocobueno1388 Posted October 15, 2006 Share Posted October 15, 2006 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 =) Quote Link to comment Share on other sites More sharing options...
trq Posted October 15, 2006 Share Posted October 15, 2006 [quote]How would I make a command line or path to that file?[/quote]This really depends on where your script is in relation to root. Something like....[code]php /home/username/public_html/cron.php[/code]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;[code]#!/usr/bin/php<?php // script here?>[/code][/code] Quote Link to comment Share on other sites More sharing options...
pocobueno1388 Posted October 15, 2006 Author Share Posted October 15, 2006 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.phpNothing happened. Quote Link to comment Share on other sites More sharing options...
pocobueno1388 Posted October 15, 2006 Author Share Posted October 15, 2006 Nevermind, it worked! Thank you so much. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.