Management Commands

Purge expired snippets

Snippets are removed as soon as they exceed their expiration date and get fetched by a client, however if they never get fetched this isn’t triggered. dpaste ships with a management command cleanup_snippets that removes these expired snippets.

It’s sufficient to run it daily.

To run it locally do:

$ pipenv run ./managepy cleanup_snippets



Does not actually delete the snippets. This is useful for local testing.

Setup a Crontab

A crontab line might look like:

1 20 * * * /srv/ run cleanup_snippets > /dev/null


If you use the database session backend, you may also need to setup a crontab that removes the expired entries from the session database.

See the related Django Documentation for details.