I use the sessions2trash.py script very successfully as an hourly task on 
PythonAnywhere.

I copied the code from the web2py scripts folder to a scripts folder under 
my app as I've modified the original code slightly to print totals of 
trashed sessions. I use the "delete after 60 minutes" settings without the 
verbose output which seems to work well for my website. The command for 
my_username and my_app would be:

python /home/my_username/web2py/web2py.py -S my_app -M -R 
/home/my_username/web2py/applications/my_app/scripts/sessions2trash.py -A 
-o -x 3600 -f

If you currently have lots of sessions in your sessions folder it might be 
better to delete most of these first (just deleting the sessions folder 
worked ok for me) before starting to run the scheduled script. 

If you wanted to change the 60 minutes setting I guess you would just alter 
the 3600 value accordingly - or modify the code yourself. 

Dane

-- 
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