RN,
I don't think so. Assuming you are running Unix or a Unix-like system such as Linux on your local machine, the script will run as a shell script on your local machine (if it's a windows box, it won't run). The first command will download cron.php from your server (I'm assuming example.com represents your server URL) to your local machine, but it won't run it (see http://www.gnu.org/software/wget/manual/wget.html#Overview). You could add a command to run it, but it would only run on your local machine, which I don't think was your intension. Finally, the rm command will delete from your local machine the file it just downloaded from your server.
Theoretically, I suppose, you could create a cron job on your local machine that would cause cron.php to be run as a command-line utility on the server, but it would have to be much more complicated, because it would have to shut down the web server (which would make it hard for it to do anything else after that, so it would have to upload itself to the server first and cause it to be run there) so that cron.php could be run without interfering with the normal operation of Moodle. Also, it would have to contain the passwords that would give it permission to cause these things to happen on the server. Otherwise, anyone on Earth could cause your server to do whatever they wanted it to do!
RLE
DS,
I stand corrected. I thought I remembered seeing some code in cron.php that would exit if it was run from the web instead of on a command line, but I must have been mistaken. But you have to admit that some of what I wrote about RN's script was true. Am I right?
RLE
The other suggestions in this thread are correct - by running the wget command you are in effect executing the script on the remote server, not your local PC.
Ryan: assuming you are running a Linux machine at home, you can easily create a new cron entry to run cron.php in your Moodle install.
At a terminal type 'crontab -e' and add the following line:
*/5 * * * * wget -q -O /dev/null http://example.com/moodle/admin/cron.php >/dev/null 2>&1
This will run the cron script every 5 minutes on your server, it will write the downloaded file to /dev/null (basically discard it) and will suppress all errors. To check that you've entered it correctly you can type 'crontab -l' at the terminal.
Paul
(I don't know very much about linux scripting and commands; I'm new to linux)
DF,
I meant DF, not DS, in the earlier post. It was a typo. 
RLE
i think you can also use a free cronjob service. In Germany is this http://cronjob.de/. I think there are other free cron services available.
Ralf
RH (& DF),
OK. Apparently you both are ignoring me for some reason. But don't you think RN deserves to know, one way or the other, whether he can expect his script, as written, to work, and if not, what changes he needs to make???
RLE
sorry. I can't say something about the script. Its not my buisness to write and discuss scripts.
Ralf
RH,
Well, this must be a disappointment to RN, since his main question was whether the script listed in his post would do what he intended; so I will. It now appears that I was dead wrong on just about every point
, largely due to a misunderstanding of a highly misleading statement in the GNU Wget manual, and also because I mis-remembered something I thought I had seen in the code of cron.php. I'm pretty sure I saw it somewhere, but not there. I'm still a little puzzled about the "rm cron.php" line. It seems that it would delete a file of that name on his local machine, which probably doesn't exist, and if it did, why delete it? Especially since if it ever existed, it would be gone after the first time the script was run.
RLE
Saludos. Iñaki.
IA,
Either you are making the same mistake I did in misinterpreting the Wget manual, or you are using the word download in the same sense as the manual, in which case many newbies reading this forum will misunderstand your post as well. The manual says what you said, that wget with just a URL will download the URL. That's why I stupidly told RN that his wget command will simply download cron.php rather than execute it. What I should have realized is that in the context of a PHP script file in an http URL, download means execute!
In an ftp URL, that's a different story.
EDIT: Ordinarily, I suppose, when you "download" via http a PHP script, the output of the script is what actually gets downloaded, and if you use wget it will be saved in a local file with the same name as the script. But in the case of cron.php, I don't think there is any output (I could be mistaken), so I don't know if this means no file would be saved, or that an empty file is saved. And if you don't delete it each time, will each subsequent download replace the previous file, append to it, save it under a different name, or will it display a message box asking the user if (s)he wants to replace the file, in which case the wget command will hang for hours if the user isn't around overnight?
RLE
[...] you are using the word download in the same sense as the manual
I'm using the word in the standard canonical sense: ask for this url to the web server and get whatever the server sends us.
How this output is created can vary from url to url, but this is irrelevant to the definition of download
But in the case of cron.php, I don't think there is any output (I could be mistaken)
Yes you are mistaken cron.php outputs quite a few lines of plain text, telling you what's doing and so on. So yes, you get a file saved on your local disk.
If you don't delete the file, each subsequent download will create a new file (by default, unless you use '-nc' or '--no-clobber') with a different name by appending the suffix .1, .2, .3 and so on. This is in the manual page too
Saludos. Iñaki.
IA,
Thank you for answering my questions. I had a hunch it might save the file under a different name each time. That's what Windows does if you use it to copy a file to a folder that already contains one with the same name.
As for the manual, I was in such a hurry to respond to RN that I didn't read the whole thing. I read enough to satisfy me that I knew what the command did, which was a big mistake. 
RLE