             cb                : undefined
         dbg = @dbg("syncstring_maintenance")
         dbg(opts)
-        inactive_syncstrings = undefined
+        syncstrings = undefined
         async.series([
             (cb) =>
                 dbg("determine inactive syncstring ids")
-                # TODO
-                cb()
+                cutoff = misc.days_ago(opts.age_days)
+                @table('syncstrings').filter(@r.row('last_active').le(cutoff)).limit(opts.limit).run (err, x) =>
+                    syncstrings = x
+                    cb(err)
             (cb) =>
                 dbg("archive patches for inactive syncstrings")
                 f = (string_id, cb) =>

                    cb         : cb
            (cb) =>
                dbg("update syncstring to indicate patches have been archived in a blob")
                # TODO
                cb()
            (cb) =>
                dbg("delete patches")
                # TODO
                cb()
        ], (err) => opts.cb?(err))

    unarchive_syncstring: (opts) =>

            cb        : undefined
        dbg = @dbg("archive_syncstring(string_id='#{opts.string_id}')")
        syncstring = patches = blob_uuid = undefined
        patches_query = @table('patches').between([opts.string_id, @r.minval], [opts.string_id, @r.maxval])
        async.series([
            (cb) =>
                dbg("get patches")
                patches_query.get (err, x) =>
                    patches = x; cb(err)
            (cb) =>
                dbg("create blob from patches")
                blob = JSON.stringify(patches)
