collective.schedule – Forget the cronjob :P use plone product to have scheduled tasks

LINK: https://pypi.python.org/pypi/collective.schedule

It provides the following:
 * A ZML interface for scheduling jobs
 * A single 'tick' job processing view that can be registered using a Zope Clock Server

u add this in eggs of buildout ..

zope-conf-additional =
<clock-server>
method /plonesite/@@schedule-tick
period 300
user username
password password
</clock-server>

this part is extra, here:

method: /plonesitepath

period:300 = each 300 second it will check fast if there is any job schedule that is pending

user: as which user u want to run the schedule task (that is the browser view that will be called)

password: password of the user

then in product where u have the browserview

in configure.zcml

<configure
xmlns:schedule=”http://namespaces.zope.org/schedule”&gt;
<schedule:job
view=”myview”
unit=”day”
at=”22:00″
/>
</configure>

here view= the browserview name
unit could be “day” = means every day, “hour”= means every hour, “minute”=means every minute
at=”HH:MM” hour minute exactly when it should run
then u add it and restart

Hope this helps someone as it helped me a lot.

 

Advertisements
About

Work is fun!

Tagged with: , , , , , ,
Posted in ploneCMS, python, Tips And Tricks, Ubuntu, Zope

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Disclaimer
All content provided on this "tareqalam.com" blog is for informational purposes only. The owner of this blog makes no representations as to the accuracy or completeness of any information on this site or found by following any link on this site. The owner of [tareqalam.wordpress.com] will not be liable for any errors or omissions in this information nor for the availability of this information. The owner will not be liable for any losses, injuries, or damages from the display or use of this information.
November 2013
M T W T F S S
« Oct   Dec »
 123
45678910
11121314151617
18192021222324
252627282930  

Enter your email address to follow this blog and receive notifications of new posts by email.

Join 23 other followers

%d bloggers like this: