<?php
/*  install with crontab
 *  $ sudo crontab -e
 *    0 * * * * cd /var/www/radon && /usr/bin/php /home/jb6113/radon-ble-rd200/frontend/cache-updater.php
 *    30 * * * * cd /var/www/radon && /usr/bin/php /home/jb6113/radon-ble-rd200/frontend/cache-updater.php
 */
require_once("db-frontend.php");

partialUpdate(96 /* hours */);

function partialUpdate($hours) {
    CACHE_DB::createCacheDb(
        time() - (intval($hours) /* hours */ * 60 * 60),
        time()
    ); 
}

//while(sleep(10 /* minutes */ * 60 /* seconds */)) partialUpdate(96 /* hours */);
