Skip to main content

A beaker plugin that implements a function to be called from the command line via PasteCall.

Project description

This is a beaker plugin which exposes a cleanup function. The cleanup function cleans the old session data created by beaker database backend.

It uses a PasterCall plugin to expose the cleanup to the console.

Mercurial repository: bitbucket.org.

Installation

easy_install:

$ <env>/bin/easy_install BeakerCleanup

pip:

$ <env/bin/pip install BeakerCleanup

General usage

$ <environment>/bin/paster call beaker.scripts:cleanup path/to/config.cfg 4h bkr.session

beaker.scripts:cleanup is an entry point to the cleanup function

path/to/config.cfg is a path to the WSGI config file containing beaker session parameters (usually .cfg or .ini)

4h tells to clean up sessions which are older than (has accessed before) 4 hours. You can give

  • 1m, 18m, 76m, etc - minutes

  • 1h, 4h, 25h, etc - hours

  • 1d, 2d, 32d, etc - days

bkr.session (optional, default: 'beaker.session') is a prefix which is needed to find the beaker session parameters in the config file. It allows you to choose which backend to clean up when you have more than one. E.g.:

bkr.session.url = sqlite:///my.db
bkr.session.table_name = sessions

Usage examples

If you are mostly using defaults your call could be similar to this:

$ paster call beaker.scripts:cleanup my/config.ini 5h

If you are using a virtual environment <env> you’ll call it like this

$ <env>/bin/paster call beaker.scripts:cleanup <env>/prod.ini 3d

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

BeakerCleanup-0.1.1.zip (6.7 kB view hashes)

Uploaded Source

BeakerCleanup-0.1.1.tar.gz (2.8 kB view hashes)

Uploaded Source

Built Distributions

BeakerCleanup-0.1.1-py2.6.egg (4.7 kB view hashes)

Uploaded Source

BeakerCleanup-0.1.1-py2.5.egg (7.7 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page