curl cronjob

Asked by:
exclamation
Time:
2012-10-12 11:23 pm
Category:
Website Troubleshooting
Hits:
303
i have been trying to setup a cron job with Curl but it always come back with the same message

here's the cron command

curl -s --user-agent local http://www.mywebsite.com/mail-test.php> /home/user/cron.log


and here's the error message from cron.log

% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed

0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
111 334 111 334 0 0 4659 0 --:--:-- --:--:-- --:--:-- 163k


403 Forbidden

Forbidden
You don't have permission to access /test-mail.php
on this server.
Additionally, a 404 Not Found
error was encountered while trying to use an ErrorDocument to handle the request.


is there something wrong with my command

it runs fine on my browser address bar but not on cron

any help appreciated



You must login before you can ask a follow up question.

You must login before you can submit an answer.

OTHER ANSWERS

0

arnelc
2012-10-12 11:55 pm
Hello Exclamation,

I took a look at your code an it appears that you're trying to trigger some PHP code from within a CGI-BIN script. You will not be able to do that in this shared server environment, primarily, because the execution of the script is typically labeled with a user name, but when running it from CGI-BIN, it may be trying to run incorrectly. You should be able to specify the script directly in CRON job. Check out this tutorial for further information on this issue:

CRON job tutorial information

If you have any further questions, please contact technical support or leave a comment at the bottom of the page.

Regards,

Arnel C.

You must login before you can post a comment about this answer.

Like this Question?

Support 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.