Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
Comment #1
jonathan1055 CreditAttribution: jonathan1055 commentedLooks good. Can you give us a screen shot of before and after?
Comment #2
jonathan1055 CreditAttribution: jonathan1055 commentedIgnore 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
Comment #3
coredumperror CreditAttribution: coredumperror commentedI 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.
Comment #4
jonathan1055 CreditAttribution: jonathan1055 commentedLooks 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
Comment #5
coredumperror CreditAttribution: coredumperror commentedAh, 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 justwget
will work, though. Considering thatcurl
is already like that, it would make both options more consistent, too.Comment #6
jonathan1055 CreditAttribution: jonathan1055 commentedYou 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/
Comment #7
coredumperror CreditAttribution: coredumperror commentedYes, I tested the wget and curl syntaxes on both OSX 10.6 and Linux.
Comment #8
jonathan1055 CreditAttribution: jonathan1055 commentedIn 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.
Comment #9
rickmanelius CreditAttribution: rickmanelius commentedHi Everyone. This was committed. Thanks! http://drupalcode.org/project/scheduler.git/commit/86ce2ff.
Comment #10
jonathan1055 CreditAttribution: jonathan1055 commentedConfirmed OK.
Thanks Rick