Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

My work's server is Ubuntu.

I have the following cron set.

MAILTO=myemail@gmail.com */30 * * * * /usr/bin/wget http://moodle.mywork.org/admin/cron.php

I know that Cron.php is working.

I get the following email.

--2010-06-28 07:40:01-- http://moodle.mywork.org/admin/cron.php Resolving moodle.skagerak.org... Connecting to moodle.skagerak.org||:80... failed: Connection timed out. Retrying.

--2010-06-28 07:43:11-- (try: 2) http://moodle.mywork.org/admin/cron.php Connecting to moodle.skagerak.org||:80... failed: Connection timed out. Retrying. ... ...

--2010-06-28 08:42:17-- (try:20) http://moodle.mywork.org/admin/cron.php - Hide quoted text - Connecting to moodle.skagerak.org||:80... failed: Connection timed out. Giving up.

But I don't get email anymore.

Q1. It is telling that failed and giving up. How can I fix it?

Q2. Why it is not sending email notice any more?

Thanks in advance.

share|improve this question
Try at least to ping moodle.mywork.org from your server. It will give you an hint about if you can reach or not the host. –  Weboide Jun 28 '10 at 21:22
You might want to change your title. Cron is working. The job failed. –  d-_-b Jun 30 '10 at 0:47

1 Answer 1

up vote 0 down vote accepted

Remove the last slash on /usr/bin/wget/. The binary is /usr/bin/wget. Also make sure that wget http://moodle.mywork.org/admin/cron.php works. Currently it looks like your web server won't serve the file.

share|improve this answer
/wget/ was my typo. It is /wget on my crontab -l. When I visit moodle.mywork.org/admin/cron.php on a browser, it gives back the result. So it is working. –  shin Jun 28 '10 at 8:46
Call wget http://moodle.mywork.org/admin/cron.php in a shell on the server which will run the cron job and see if it's working. –  joschi Jun 28 '10 at 8:48
It outputs, moodle.mywork.org/admin/cron.php Resolving moodle.mywork.org ... 81.167. bla bla Connecting to moodle.mywork.org|81.167. bla bla... Connection timed out. And then it is repeating again. If I visit it on a browser, it shows the result. What am I doing wrong? –  shin Jun 28 '10 at 8:58
Are you behind a proxy? And if so, do you have $http_proxy set? Also, are you trying to browse to the website from the box you're running wget on, or from a different box? –  Cian Jun 28 '10 at 9:09
I can't tell you what to set your http proxy to if you don't know whether or not you have one. Either way, the problem is probably a firewall in the way either with different rules for your desktop, or that only allows connections to your http proxy. –  Cian Jun 28 '10 at 9:43

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.