Hi all, I was looking for a clean way to auto-update views (e.g. after a certain number of document inserts) while avoiding running cron jobs. I chose to use an os_daemon script since this ties the daemon explicitly to couch, meaning I can stop and start couch and ensure that this script starts with it.
I wanted to submit the solution here for comments and suggestions, and also because I didn't find a similar script around in the documentation. I would also link on the wiki but I don't yet have rights. The daemon may be configured to force a view update after a given number of document inserts. This might not fit all use cases well, but it fits ours since we have a steady (roughly constant) stream of documents being inserted. Certainly, different requirements could use this script as a starting point. Some possible updates I have in mind include updating to read configuration from the couchdb config as well as perhaps some other solution for storing credentials for password-protected dbs (suggestions?). Here is the gist, I welcome your comments or suggestions: https://gist.github.com/mgmarino/6117801 Cheers, Mike
