Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // for Autodor.SQLite.Wmsn https://goo.gl/QiUFBc
- #=============fast server http://vk.cc/7BSP3h ===========
- // Срабатыват при при заходе человека или робота на сайт))
- <?
- //Запуск каждый день Файл сам создается!
- if (!file_exists('data.txt')) {file_put_contents("data.txt","");}
- $fdata=file_get_contents("data.txt");
- $data = date("ymd"); if ($data!=$fdata)
- { file_put_contents("data.txt", date("ymd"));
- //Ваш скрипт тут
- }
- ?>
- ------------------------------------------------------
- <?
- //Запуск каждые 1 часов. Файл сам создается!
- $last_cron_time = file_get_contents("data1.txt");
- $period = time() - 60 * 60 * 1; //Где 1 это 1 час. (Ставить больше 6-24 часов не рекомендуется, так как время обнуляется в 00,00)
- if ($last_cron_time < $period)
- { file_put_contents("data1.txt", time());
- //Ваш скрипт тут
- }
- ?>
- -------------------------------------------------------
- <?
- //Запуск скрипта при изменении файла
- if (!file_exists('file.txt')) {file_put_contents("file.txt","");}
- $ddd = 'db/' .$host. '.db'; //Путь к файлу, в данном случае база
- $crontime2=filesize($ddd);
- $crontime1=file_get_contents("file.txt");
- if ($crontime1!=$crontime2 and $crontime2 < 40 * 1024 *1024 ) //и файл меньше 40Мб
- { file_put_contents("file.txt", filesize($ddd));
- //Ваш скрипт тут
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement