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.

when running a cron job like this:

curl http://example.com/cronjob.php

The output sent to mail contains this:

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

 0    52    0    52    0     0     81      0 --:--:-- --:--:-- --:--:--    81
 0    52    0    52    0     0     31      0 --:--:--  0:00:01 --:--:--     0
 0    98    0    98    0     0     37      0 --:--:--  0:00:02 --:--:--    23
 0    98    0    98    0     0     27      0 --:--:--  0:00:03 --:--:--    15
 0    98    0    98    0     0     21      0 --:--:--  0:00:04 --:--:--    11
100   144    0   144    0     0     25      0 --:--:--  0:00:05 --:--:--    18
100   144    0   144    0     0     21      0 --:--:--  0:00:06 --:--:--    18
100   190    0   190    0     0     23      0 --:--:--  0:00:07 --:--:--    17
100   190    0   190    0     0     21      0 --:--:--  0:00:08 --:--:--    17
100   236    0   236    0     0     24      0 --:--:--  0:00:09 --:--:--    27

I find this totally useless and would prefer just the code output. Is there any way to disable this?

I don't get this if the cronjob is run like below:

php /path/to/the/phpfile.php

But right now, I do not have an option but to use curl.

share|improve this question
add comment

2 Answers

Searching in man curl: ...

  -s/--silent
          Silent mode. Don’t show progress meter or error messages.
          Makes Curl mute.

So curl -s http://example.com/cronjob.php will do the trick.

You may want to use the following option as well:

   -S/--show-error
          When used with -s it makes curl show error message if it fails.

Hope it helps.

share|improve this answer
    
Thank you - curl -sS http://example.com/cronjob.php worked great for me. –  Dave James Miller Sep 19 '12 at 10:47
add comment

Have you tried:

 curl --silent http://example.com/cronjob.php >>/path/to/output.log 2>&1

??

share|improve this answer
add comment

Your Answer

 
discard

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.