Re: Set up cron using PHP
| From: | Alexandru E. Ungur | Date: | Thu, 07 Oct 2004 13:51:00 +0000 |
| Subject: | Re: Set up cron using PHP | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-198832@lists.php.net to get a copy of this message | ||
/* sender: "M. Sokolewicz" date: "Thu, Oct 07, 2004 at 02:32:17PM +0200" */
> ...
> You can call this as follows:
> ----
> * * * * * * wget
> http://www.example.net/scripts/bin/mail.php?user=a&pass=b ;
> rm -f ./mail.php
> ----
>
> The first part will call the server via an http connection to run the
> script and show its output. It then downloads it to the directory run
> from, and saves it. That is what wget does. The second part, after the
> semicolon, the 'rm -f ./mail.php' will make sure to get rid of the file
> after it's been run.
Very nice solution :)
Just one observation: you can use the -O parameter of wget, and get rid of rm
----
* * * * * * wget http://www.example.net/scripts/bin/mail.php?user=a&pass=b
-O /dev/null
----
Alex