Hi All,
I'm trying to create a cron job that will send a weekly newsletter. I tried creating a shell task following what Cakephp manual says. Then I go to the Media Temple Cron jobs and type in the following:
php /home/#####/domains/domain.com/html/cake/console/cake -app /home//#####//domains/domain.com/html/vendors/shells newsletter
I created the shell task on vendors/shell folder and named it newsletter.php and here's the code for it:
class NewsletterShell extends Shell {
function main() {
$this->sendEmailTo("Newsletter","subject","[email protected]");
}
}
The sendEmailTo is a controller function I have in my appController so all my controller have access to it.
My problem is every time the Cron Job runs I get this message:
Could not open input file: /home/#####/domains/domain.com/html/cake/console/cake
I even gave all the console files (cake.php , cake.bat etc) 0777 read write properties as well as for the vendors/shell/newsletter.php
The ##### are the site number that media temple gives you but I'm not really sure I have it correct. They show an example of a cron job like this: /home/50838/data/script-name.sh
So my questions are:
Is my cake shell task correct and is the way I'm running it as a cron job accurate?
Also does anyone know where to confirm my media temple site number so I can write that off as a possible error.
Thanks in advance,
Fabian