curl cronjob

Asked by:
exclamation / 8 Points
Time:
2012-10-12 7:23 pm EST
Category:
Website Troubleshooting
Hits:
705
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



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

To submit an answer, please login.

ANSWERS

0

arnelc
Staff
9,387 Points
2012-10-12 7:55 pm EST
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.

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

Want to share this Question?

News / Announcements

Update to SSL Certificates - Certificate Warnings
1969-12-31 11:00 am EST
Hits: 696

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!

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.