cronjob command help

Asked by:
blainecar / 25 Points
Time:
2013-07-15 5:25 am EST
Category:
How To
Hits:
402
I am trying to get a command to work in my cronjobs but it seems to not want to run.

The command I am trying to run is as follows;

forecast-compare-include.php?log&config=on

Does anyone know how I can get it to run?
I think the arguements are causing the problems

To ask this user for more information, please first login.

To submit an answer, please login.

ANSWERS

0

johnpaulb-whh2
Staff
12,339 Points
2013-07-15 4:32 pm EST
Hello blaincar,

Thank you for your question. You can run a cron job as a PHP script, here is a full guide on how to run a cron job.

Essentially, you would call in the PHP script like this:

php -q /home/username/public_html/scripts/testrun.php


If you have any further questions, feel free to post them below.
Thank you,

-John-Paul

To submit a comment on this answer, please first login.

This option won't work. I need to pass parameters with it
(according to everything I have read about cron commands)
blainecar
25 Points

2013-07-15 10:34 pm EST
Hello Blainecar,

Basically, the command would look something like this:

php -q /home/username/public_html/forecast-compare-include.php? log=on config=on

I'm not sure what value you need to give "log", so you should replace it with the appropriate value in your cron job. Check the following article to see more of a reference for passing the variables in a PHP script.

I hope this helps to clarify the issue! If you have any further questions, please let us know.

Regards,
Arnel C.


arnelc
17,314 Points
Staff
2013-07-15 11:20 pm EST
log is just a parameter,, it doesn`t really have a value

This is the part that is giving me the problem
blainecar
25 Points

2013-07-16 3:11 am EST
Hello Blainecar,

I took a long through PHP documentation, asked a few systems people here, and then took another look through forums. I can find NO example of log used as a parameter, especially in the way you're using it. However, it doesn't mean that it isn't correct. First, are you getting any PHP errors that are logged when you try to use the log parameter in the cron job? Also, what exactly are you trying to do with the parameter? There are other commands (which have values assigned for their function) that may do what you want. Check out this article and see if it matches up with up you're trying to accomplish: PHP Error and Logging. Otherwise, you may need to consult with a programmer for this particular answer. If you can give us a little more information, we might be able to find the answer for you.

Hope that helps to point you in the right direction. Please let us know if you require any further assistance.

Regards,
Arnel C.
arnelc
17,314 Points
Staff
2013-07-16 3:51 am EST
Want to share this Question?

Related Articles

It looks like there are no related articles.
Would you like to ask a question about this page? If so, click the button below!
Need More Help?

Help Center Search

Current Customers

Email: support@WebHostingHub.com Ticket: Submit a Support Ticket
Call: 877-595-4HUB (4482)
757-416-6627 (Intl.)
Chat: Click To Chat Now

Ask the Community

Get help with your questions from our community of like-minded hosting users and Web Hosting Hub Staff.

Not a Customer?

Get web hosting from a company that is here to help.
}