On Tuesday, December 4, 2018 at 9:34:44 PM UTC-8, Dave S wrote:
>
>
>
> On Tuesday, December 4, 2018 at 12:17:52 AM UTC-8, Gaël Princivalle wrote:
>>
>> Hello.
>>
>> Is there a way to delete automatically the sessions?
>> I mean the folders/files inside this folder:
>> web2py/applications/my_app/sessions
>>
>> For example deleting the sessions oldest than 1 week.
>>
>> Thanks!
>>
>
> I also run the sessions2trash.py script.  On one application, I'm getting 
> a few hits a minute.  I started running it 1x manually.  I'm currently 
> using atq to run it once a week (originally once every two weeks).
>
> (echo 'python web2py.py -S myapp -M -R scripts/sessions2trash.py -A -x -x 
> 3600 -f -v' | at Dec 6 1800)
>
> If I run it more often, I'll probably use the built-in scheduling.
>
>  
Yep, copied the script to modules, added the recommended function to 
models/scheduler.py, and commenced daily cleaning.

If you want to see something in the scheduler_run table, add something like

    return "done"


to the function.

/dps

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to