cache-updater.php 564 B

123456789101112131415161718
  1. <?php
  2. /* install with crontab
  3. * $ sudo crontab -e
  4. * 0 * * * * cd /var/www/radon && /usr/bin/php /home/jb6113/radon-ble-rd200/frontend/cache-updater.php
  5. * 30 * * * * cd /var/www/radon && /usr/bin/php /home/jb6113/radon-ble-rd200/frontend/cache-updater.php
  6. */
  7. require_once("db-frontend.php");
  8. partialUpdate(96 /* hours */);
  9. function partialUpdate($hours) {
  10. CACHE_DB::createCacheDb(
  11. time() - (intval($hours) /* hours */ * 60 * 60),
  12. time()
  13. );
  14. }
  15. //while(sleep(10 /* minutes */ * 60 /* seconds */)) partialUpdate(96 /* hours */);