                     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) ->

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

                    bup_dir : bup_active
                    cb      : (err, info) ->
                        rollback_info = info
                        cb(err)

            # get deployed location of project (which can change at any time!)
            (cb) ->
