[Catalyst] Running Catalyst App from Command Line (or via Cron)

J. Shirley jshirley at gmail.com
Fri Jan 8 16:20:04 GMT 2010


On Fri, Jan 8, 2010 at 7:58 AM, Christoph Friedrich
<christoph at christophfriedrich.de> wrote:
> Hello there,
>
> I need to build a script for my catalyst application that reads some data
> and put it into the database. This script needs to run as a daily cron job.
> My first idea was to create a controller which handles this for me and use
> some of the other engines for catalyst (like Catalyst::Engine::Embeddable or
> Catalyst::Engine::JobQueue::POE) but I'm not sure if this is a good way.
> Does someone of you have an idea how to make such a script? Maybe some Best
> Practices?
>
> Greets
> Christoph
>


I would create a standalone perl class that does everything you need,
then in your Catalyst app just implement a thin adapter using
something like Catalyst::Model::Adapter (or
Catalyst::Component::InstancePerContext).

I wouldn't bother with Catalyst in the crontab, instead just
instantiate this model and have it do what needs done.

-J



More information about the Catalyst mailing list