I've developed a small patch to improve the documentation on Scheduler's Lightweight Cron help page (admin/config/content/scheduler/cron). I fixed the wget params so they don't print out the HTML that gets generated from the scheduler/cron page, and updated the curl and wget params to be more copy-paste friendly by including the server's actual hostname (instead of example.com).

I hope you guys like it!

Comments

Looks good. Can you give us a screen shot of before and after?

Ignore my last comment about screenshot, I thought when you said 'fixed so they dont print out the html' that there was a problem in the original display of the help page. Now I looked in more detail, I can see you have just added/removed some parameters.

You have reordered some parameters. Is that significant? Looks like you are not using > but using -s -o instead, as you've removed the 2>&1. Could explain the details of the changes, as obviously you have realised that it could be improved so you know what was wrong before.

Thanks.
Jonathan

I just noticed that since wget was using the -O - param (which directs the downloaded file to stdout), and then redirecting stdout to /dev/null, it might as well just be -O /dev/null. Then, from that, I looked into the docs for curl, and found the -o /dev/null option, and the -s option (which disabled the progress meter).

Now, both programs use equivalent options to do the same thing: totally silence the output of the download.

Looks good. Then I spotted that $_SERVER['HTTP_HOST'] does not give the right path for all cases. I have Drupal 7 installed below my root directory. Take a look at the screen shots.

I have made a new patch using $GLOBALS['base_url'] and also moved the variables out of the double-quoted string to avoid the backslashes.

Here is an updated patch, for you to try.

Jonathan

Ah, of course. I should have realized that HTTP_HOST would be innadequate, but I didn't know about $GLOBALS['base_url']. Your fix works for me.

Although, there's something else I just remembered: wget isn't always at /usr/bin/ on every unix machine (like my OSX Snow Leopard box). It looks like replacing /usr/bin/wget with just wget will work, though. Considering that curl is already like that, it would make both options more consistent, too.

You are right, wget may not be stored in /usr/bin
I am on a mac 10.4 and I do not have wget at all, so I can't test it. I know I could download it but do not want to do that just for this patch.

The curl syntax works fine for me. I presume you have tested the wget syntax you suggested?

Here is the patch without /usr/bin/

Yes, I tested the wget and curl syntaxes on both OSX 10.6 and Linux.

Status:Needs review» Reviewed & tested by the community

In that case ... RTBC
Eric, if you agree, this patch should be committed before #1199908: Some missing translations as that patch will need a re-roll anyway.

Status:Reviewed & tested by the community» Fixed

Hi Everyone. This was committed. Thanks! http://drupalcode.org/project/scheduler.git/commit/86ce2ff.

Confirmed OK.
Thanks Rick

Status:Fixed» Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.