I am using Zend Framework 1.9.6. I want to start using cron jobs. I am new to this so I'm not quite sure how to do this.
I'm thinking it would be a good idea to store my crons in /myapp/scripts
or /myapp/application/cronjobs
. What do you think? (my application only has a default module)
Once I've decided on a place to store them, how would I go about creating a script? Let's say that I want to access a database, check for changes, and send an email as a report. I would need to use some Zend_Db
components, and Zend_Mail
components, as well as read the default config values. I guess I might even want to Bootstrap the application? But I won't need any views so I don't know if that would be the best idea. I don't know. What should I do, and how can I do it? Again, I am using version 1.9.6 and created my application with the Zend_Tool
command-line script.
I think there's enough information online about how to add the cron job to the crontab file. (My web host also offers a tool to make this really easy, so I'm not so much interested in this part).
Have you done this in a 1.8+ application? Do you have an example script you could share?