Robert has a great module for this:
http://www.aminus.net/wiki/Recur
I've used it before and highly recommend it.
Christian
http://www.dowski.com
Dear all,
You could create a seperate thread that reads a Queue() for actions with a
timeout on the Q.get() set for when the next action is due to be performed.
Or you could be lazy like I was and create a normal URL for CP to perform the
expiry checks and have an incredibly simple script under cron that just does a
GET on that URL.
Eddie
--
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.
On May 12, 3:34 pm, Eddie Corns <E.Co...@ed.ac.uk> wrote:
> Date: Mon, 12 May 2008 06:24:17 -0700 (PDT)
> From: morellik <enrico.more...@gmail.com>
> Dear all,
>
> is it possible to execute some commands each, e.g., two days or other
> values during the CP3 application life?
>
> I wrote an application to permit to some users to share files, but I
> want that each two days the files will be removed. I can write an
> application to run under cron, but I prefer, if it's possible, to do
> under CP.
>
> You could create a seperate thread that reads a Queue() for actions with a
> timeout on the Q.get() set for when the next action is due to be performed.
>
> Or you could be lazy like I was and create a normal URL for CP to perform the
> expiry checks and have an incredibly simple script under cron that just does a
> GET on that URL.
>
> Eddie
Thanks also to you.
Can you give me the script?
Enrico
I don't have it as a stand-alone script but we're talking about something
like:
import urllib
f = urllib.urlopen('http:<your-base-url>/expire')
status = f.read()
f.close()
I usually pass back a simple string like 'OK' or 'FAIL' which goes into
status.
A command line script like curl or wget would do just as well.
Call it from cron every hour say.
The CP Root object has an exposed 'expire' method which looks for any old
files to delete and returns 'OK' or 'FAIL'.
HTH,