#!/usr/bin/env php . // lock all threads older than N days require_once("../inc/boinc_db.inc"); require_once("../inc/util.inc"); $max_age_days = 60; // lock threads older than this $t = time_str(time()); echo "starting at $t\n"; $t = time() - $max_age_days*86400; $db = BoincDb::get(); if (!$db) die("can't open DB\n"); $db->do_query("update DBNAME.thread set locked=1 where timestamp<$t and locked=0 and sticky=0"); $n = $db->affected_rows(); $t = time_str(time()); echo "finished at $t; locked $n threads\n"; ?>