[web2py] Re: sessions2trash.py

2015-02-23 Thread Niphlod
now it's in trunk, so next releases will be fine. On Monday, February 23, 2015 at 10:31:09 AM UTC+1, Annet wrote: > > Hi Niphlod, > > Thanks for the time and effort you put into fixing this issue, the dropbox > script does clean > up de folder structure. > > Best, > > Annet > -- Resources: - h

[web2py] Re: sessions2trash.py

2015-02-23 Thread Annet
Hi Niphlod, Thanks for the time and effort you put into fixing this issue, the dropbox script does clean up de folder structure. Best, Annet -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/w

[web2py] Re: sessions2trash.py

2015-02-20 Thread Niphlod
another correction (this time final). recfile generates at most 512 folders each containing at most 512 folders. cleanup of all of them lasts 20 seconds in a modest hardware. On Thursday, February 19, 2015 at 10:30:10 PM UTC+1, Niphlod wrote: > > correction, too humble. My analysis degree never

[web2py] Re: sessions2trash.py

2015-02-19 Thread Niphlod
correction, too humble. My analysis degree never came to reality :P it's not 560, it's 3360 On Thursday, February 19, 2015 at 10:12:09 PM UTC+1, Niphlod wrote: > > PS: from my humble calculations inside session there can be AT MOST 560 > folders that can contain each one 560 folders. it's not th

[web2py] Re: sessions2trash.py

2015-02-19 Thread Niphlod
PS: from my humble calculations inside session there can be AT MOST 560 folders that can contain each one 560 folders. it's not that much for a production environment, but I get the argument of keeping the dev environment clean. -- Resources: - http://web2py.com - http://web2py.com/book (Docu

[web2py] Re: sessions2trash.py

2015-02-19 Thread Niphlod
you found a bug that seems just a "typo". Fixing it works, but not completely: it tries to delete only the parent folder of a session file that got deleted (and quite frankly a bit slow, checking for every file). I'll simplify with an example: the "new storage scheme" is roughly appname/session

[web2py] Re: sessions2trash.py

2015-02-19 Thread Niphlod
uhm, strange. I opened the code and saw this https://github.com/web2py/web2py/blob/master/scripts/sessions2trash.py#L167 I though it worked. Let me test it and I'll get back here ASAP. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (

[web2py] Re: sessions2trash.py

2015-02-19 Thread Annet
Hi Niphlod, Thanks for your reply. I tested the sessions2trash.py from: https://github.com/web2py/web2py/ The script deletes the sessions but does not delete the folder structure, so the empty folders still pile up. It does return a different output: Last login: Thu Feb 19 12:37:33 on ttys000

[web2py] Re: sessions2trash.py

2015-02-17 Thread Niphlod
trunk version fixes the issue On Tuesday, February 17, 2015 at 1:56:23 PM UTC+1, Annet wrote: > > I have web2py 2.9.11 installed, I did not update from a previous version. > > When I run the following command: > > lionserver:web2py_develop mymac$ python web2py.py -S init -M -R > scripts/sessions2

[web2py] Re: sessions2trash.py and memory usage

2014-07-17 Thread Annet
@Simone, Thanks for your reply and explanation of cron and cleaning up sessions. > PS: you definitely DO NOT want to schedule apache on cron > That's what Webfaction's install script for Web2py does by default, also they keep telling me: But note that cron jobs are better for such periodic t

[web2py] Re: sessions2trash.py and memory usage

2014-07-16 Thread Jose C
Hi Annet, I'm also with webfaction and do my session cleanups like this: (this is one line in the crontab): # Delete sessions that are older than 1 day from the disk. 18 1 * * * /usr/local/bin/python2.7 /home/my_username/webapps/my_w2p_app_dir /web2py/web2py.py --nogui --no-banner -S myweb2pyap

[web2py] Re: sessions2trash.py and memory usage

2014-07-16 Thread Niphlod
I'm starting to think we talk two different languages (and there's a little bit of lack of shell scripting on your side). cron syntax is a taddle bit universal that being said there is a subtle difference between web2py's cron and a "normal" cron (explained in the book). Cron is made specifi

[web2py] Re: sessions2trash.py and memory usage

2014-07-16 Thread Annet
Since I have access to my system's own cron service I use *external cron* The issue seems to be that */5 * * * * ~/webapps/w2p/web2py/web2py.py -S admin -R scripts/sessions2trash.py & */5 * * * * ~/webapps/w2p/web2py/web2py.py -S mypynex -R scripts/sessions2trash.py & are starting web2py and i

[web2py] Re: sessions2trash.py and memory usage

2014-07-16 Thread Niphlod
did you try to inspect the log of the cron job adding a -v , i.e. web2py.exe -S mypynex -M -R scripts/sessions2trash.py -A -o -x 3600 -f -v ? On Wednesday, July 16, 2014 11:48:36 AM UTC+2, Annet wrote: > > No, all these lines added up to 549 MB, my limit is 512 MB. > > I commented out: > > */5 *

[web2py] Re: sessions2trash.py and memory usage

2014-07-16 Thread Annet
No, all these lines added up to 549 MB, my limit is 512 MB. I commented out: */5 * * * * ~/webapps/w2p/web2py/web2py.py -S admin -R scripts/sessions2trash.py & */5 * * * * ~/webapps/w2p/web2py/web2py.py -S mypynex -R scripts/sessions2trash.py in my cron tab, which solves the issue, however, I

[web2py] Re: sessions2trash.py and memory usage

2014-07-16 Thread Niphlod
14 MB is "over your limit" ? change hosting provider. On Wednesday, July 16, 2014 10:46:58 AM UTC+2, Annet wrote: > > To clean up session on my production environment I thought of calling the > sessions2trash.py this way: > > nohup python ~/webapps/w2p/web2py/web2py.py -S admin -R > scripts/sess

Re: [web2py] Re: sessions2trash.py

2014-02-06 Thread Niphlod
On Thursday, February 6, 2014 5:28:17 AM UTC+1, Jayadevan M wrote: > > Thanks for the reply. Let me provide more info. May be I missed something > very basic. I am replying inline to your/Ricardo's comments. > > > "BTW..you're 10 steps ahead.but you're calling it wrongly :-P" > I gu

Re: [web2py] Re: sessions2trash.py

2014-02-05 Thread Jayadevan M
Thanks for the reply. Let me provide more info. May be I missed something very basic. I am replying inline to your/Ricardo's comments. "BTW..you're 10 steps ahead.but you're calling it wrongly :-P" I guess I am calling it wrongly. Did not get the 10 steps ahead part "the args of th

Re: [web2py] Re: sessions2trash.py

2014-02-05 Thread Niphlod
BTW..you're 10 steps ahead.but you're calling it wrongly :-P the args of the script are -f --> ignores session expiration (deletes either via -x or auth.settings.expiration) -o --> does an execution then exits -s --> sleep (in case -o isn't passed and the script is always "alive") -

Re: [web2py] Re: sessions2trash.py

2014-02-05 Thread Ricardo Pedroso
On Wed, Feb 5, 2014 at 2:15 PM, Jayadevan M wrote: > > open("applications/myapp/sessions", > O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = 4 > getdents(4, /* 2 entries */, 32768) = 48 > getdents(4, /* 0 entries */, 32768) = 0 > close(4)= 0 > If I'm not wrong

[web2py] Re: sessions2trash.py

2014-02-05 Thread Jayadevan M
I did that and straced the process. Output says - strace -p 19227 Process 19227 attached - interrupt to quit select(0, NULL, NULL, NULL, {37, 995138}) = 0 (Timeout) gettimeofday({1391609487, 826517}, NULL) = 0 stat("/etc/localtime", {st_mode=S_IFREG|0644, st_size=3519, ...}) = 0 gettimeofday({13

[web2py] Re: sessions2trash.py

2014-02-05 Thread Niphlod
if you start it outside uwsgi, you'll see the verbose output (given you're passing -v as an option) On Wednesday, February 5, 2014 2:26:04 PM UTC+1, Jayadevan M wrote: > > I have set the sessions2trash script in my web2py.ini (for uwsgi) like > this - > > cron = 0 0 -1 -1 -1 python /var/www/we

[web2py] Re: sessions2trash.py not working in v2.2.1, fix included

2012-10-25 Thread Massimo Di Pierro
Thanks, in trunk! On Wednesday, 24 October 2012 18:22:02 UTC-5, Jim Karsten wrote: > > current.response._dbtable_and_field is referenced in sessions2trash.py. > That value was replaced in version 2.2.1 with > current.response.session_db_table, current.response.session_db_record_id, > and curren

[web2py] Re: sessions2trash.py "global name 'db' is not defined"

2012-01-11 Thread Chris
That did it, not sure why I missed it. Thanks much. On Jan 11, 3:23 pm, Jonathan Lundell wrote: > On Jan 11, 2012, at 11:49 AM, Chris wrote: > > > > > > > > > > > I am getting an error when I run the following script in my web2py > > directory: > > > # python web2py.py -S init -R scripts/sessions

[web2py] Re: sessions2trash.py improved

2011-05-09 Thread Ross Peoples
Glad to see this made it into the trunk!