Re: cron job style php...
| From: | Bret Hughes | Date: | Sun, 16 Jan 2005 23:27:30 +0000 |
| Subject: | Re: cron job style php... | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-206495@lists.php.net to get a copy of this message | ||
On Sun, 2005-01-16 at 17:00, Russell P Jones wrote:
> I have written a simple script that when a date in an array matches todays
> date, it sends an email (notifies me when bills are due). Any ideas on how
> to make this run once a day? Can you do a cron job on a PHP prog?
>
> Russ Jones
Never tried it but on linux (RHL or Fedora) I would add a file to
/etc/cron.daily with something like this in it
/usr/bin/php /usr/local/bin/myjob.php
where myjob.php is the php script. if it runs from the command link
now it should work. This will run as root of course and if you wnated
it to be run as someone else you could probably add the line:
0 2 * * * username /usr/bin/php /usr/local/bin/myjob.php
to /etc/crontab or the users crontab without the username field.
hth
Bret