@ Travis: What are those various reasons for not liking the shell
method of running CronJobs as endorsed by the CakePHP developers?

@ internetchris: I have just followed the cake book's method and got
it working a dream and above all is secure.  A few things I came
across when doing this that may be useful to others as the book does
not go on to talk of running the shell from Cron which can throw up
some issues.

1. You need to make sure your /cake_installation/cake/console/cake
file has execute permissions before it can be executed (I used 754)

2. I used the following syntax when creating my CronJob in DirectAdmin
(my server's Control Panel Software)
/full_path_to_app/cake_installation/cake/console/cake -app "/
full_path_to_app/cake_installation/app" name_of_shell

3. Even though the shell ran fine from my server's command line
nothing was happening when it ran from Cron.  After some investigation
I realised Cron did not have access to my server paths so I needed to
edit the /cake_installation/cake/console/cake file and provide the
full path to the php command as follows:
# 30: exec /full_path/php -q ${LIB}cake.php -working "${APP}" "$@"

Just in case you wanted to see my shell it is as simple as follows:

<?php

class DashboardShell extends Shell {

  function main() {
    ClassRegistry::init('Staff')->__reminders();
    ClassRegistry::init('StaffCrbCheck')->__reminders();
  }
}

?>

This accesses the my __reminders() model actions directly which create
daily dashboard user alerts for the management application I am
creating.

Hope this is helpful,

Paul Gardner
Webbed IT
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" 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
-~----------~----~----~----~------~----~------~--~---

Reply via email to