3 This part ensures that we don't get run TOO often. It implements
4 a delay and looks up when we actually ran the last time.
7 define("ANACRON_ID", "etc/anacron/last-run");
8 define("ANACRON_PAUSE", 20); // in seconds, minimum delay between runs
12 $data = ewiki_db::GET(ANACRON_ID);
13 if ($data && ($data["flags"] & EWIKI_DB_F_SYSTEM)) {
14 echo "[$cron]: reading in anacron timestamps\n";
15 $anacron = unserialize($data["content"]);
18 echo "[$cron]: first run ever\n";
30 if ($anacron["last"]+ANACRON_PAUSE >= time()) {
31 echo "[$cron]: oooops, we're beeing called to often, the minimum interleave is " . ANACRON_PAUSE . " seconds\n";
35 #-- prepare state flags?
39 // we define this a third time here, in case it really was missed
41 @define("EWIKI_CRON", time());