Jump to content

Cron Job (Command Line) *SOLVED*


pocobueno1388

Recommended Posts

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 =)

Link to comment
Share on other sites

[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]
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.