                     cb   : (err) ->
                         winston.debug("time to index #{project_id}: #{misc.walltime(t)} s")
                         cb(err)
+
+            # write rollback file
+            (cb) ->
+                fs.writeFile rollback_file, misc.to_json(rollback_info), cb
 
             # save
             (cb) ->

                    project_ids = (r[0] for r in results)
                    cb(err)
        (cb) ->
            winston.info("recently modified projects: #{misc.to_json(project_ids)}")

            v = []
            for id in project_ids
                if age_of_most_recent_snapshot_in_seconds(id) >= program.snap_interval
                    v.push(id)
            winston.info("projects needing snapshots: #{misc.to_json(v)}")
            snapshot_projects
                project_ids : v
                cb          : cb
    ], (err) ->
        if err
            winston.info("Error snapshoting active projects -- #{err}")
            # TODO: We need to trigger something more drastic somehow at some point...?

        setTimeout(snapshot_active_projects, 10000)  # check every 10 seconds

# Ensure that we maintain and update snapshots of projects, according to our rules.
snapshot_active_projects = (cb) ->
    project_ids = undefined
    winston.debug("checking for recently modified project.") 
    async.series([
        (cb) ->
            database.select
