Re: Running Crontab on php script
| From: | mark at amtmedia dot com | Date: | Thu, 24 May 2001 00:05:01 +0000 |
| Subject: | Re: Running Crontab on php script | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-54131@lists.php.net to get a copy of this message | ||
Richard Kurth <rkurth@pacifier.com> wrote:
>
> I have a php script that runs at root. I have php compiled as a cgi to
> do this.
> My question is what is the best way to run a crontab so that it does
> not send a message every time it runs. This script runs every 5 min
> and it can get pretty frustrating to get this email.
> The script runs only if there is another file present if the file is
> not there it shuts down. But I still get the email.
> I have it set this way right know and I only get an email if there is
> an error. Is there a better way to do it
>
> 5 * * * * /home/sites/home/auto/creatacct.php > /tmp/logdump.LOG
> 0 0 * * * /home/sites/home/auto/mail.php > /tmp/logdump.LOG
>
Like this:
5 * * * * /home/sites/home/auto/creatacct.php > /tmp/logdump.LOG 2>&1
0 0 * * * /home/sites/home/auto/mail.php > /tmp/logdump.LOG 2>&1
It makes stderr go to the same place stdout goes, which is to your log
file in this case.
Mark