You are absolutely right - this is a better solution than mine -
thanks very much Baz!
It does require learning how to send attachments (not very well
supported within native PHP) and doesn't provide scheduling though, so
rather than integrate two new modules I've stuck with my substandard
approach. If I were doing this from scratch I'd use Baz's
recommendations.
Thanks hugely for everyone's great help and inspiration
Chris
(PS. The call isnt asynchronous - the redirect happens only once the
backup has finished.)
(To implement scheduling I've done:
$ret = $this->Article->query("SELECT 1 AS BackupRequired FROM
last_backup WHERE DATEDIFF(CURDATE(), date) > 180");
if ($ret) {
// DO BACKUP
.............
$this->Article->execute("UPDATE last_backup SET date =
CURDATE()");
}
(table script:
CREATE TABLE last_backup (
date datetime NULL
) ENGINE = MYISAM ;
INSERT INTO last_backup (date) VALUES (CURDATE());
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---