Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
39 lines (30 sloc) 1.42 KB


A simple script to automatically perform the various CouchDB compaction tasks.

Versioning Note

As of Requests 1.0, some of the Requests APIs changed; resp.json went from at attribute to a method, etc. I've updated to support 1.0+ of Requests, but this means that previous versions are not supported anymore.

Usage Example

python --couch-server --all
[wait a few moments]
python --couch-server --backup

Full Usage

[bhatfield@bhatfield-mac couch-compaction]$ python --help
Usage: [options]

  -h, --help            show this help message and exit
                        Couch Database Server Hostname/IP
  --couch-port=PORT     Couch Database Server Port
  --database=DATABASE   Database to work with
  --all                 Run all compaction steps (--compact-views, --cleanup-
                          views, --compact-database)
  --compact-views       Compact each view
  --cleanup-views       Clean up previously-compacted view files
  --compact-database    Compact database
  --backup              Export database backup
                        Restore database from file