Re: Cron-job
Hello Henning!
> I have a php-site on which I want to send periodic mails out.
> I want cron to schedule that, but I don't know how to get cron to
> manage that.
> I have my own Linux-box on which I put the line
> lynx http://blabla.com/mailscript.php
> but on my hosted webserver, there are obviously no lynx, cause it don't
> work.
> Then what?
> A perl or python script?
> Anyone who can help me?
Which PHP.
You can check when the last mail was send and than send a new one. And
you can put it in our website. And when anyone view this side that
script will run and do what you want.
Example (which not works)
index.php
<?php
// Read last timestamp
$file_name = "last_mail";
$file = fopen($file_name, "r+");
$content = fread($file, filesize($filename));
$time = time();
if($file[0] >= $time + $diff) {
include "mailscript.php";
// Write time back to file
fseek($file, 0);
fwrite($file, $time);
}
fclose($file);
?>
CU
Michael
--
,''`. Michael Ott, e-mail: michael at zolnott dot de
: :' : Debian SID on Thinkpad T43:
`. `' http://www.zolnott.de/laptop/ibm-t43-uc34nge.html
`-
Jeden Mittwoch von 21 - 24 Uhr. Zosh! auf Radio Z.
Das Härteste, was der Musikmarkt zu bieten hat. http://www.zosh.de
Online hören: http://www.radio-z.net
Reply to:
- References:
- Cron-job
- From: "Henning Olsen" <henningolsen36@gmail.com>