Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include_once (dirname(__file__) . '/../includes/config.php');
- do
- {
- $toKill = $db->query('select id,md5id,pid,mysqlid from accounts where next_action_run=1 and last_proc_time < DATE_SUB(NOW(), INTERVAL 20 MINUTE) and activity_status = 1');
- foreach ($toKill as $key => $val)
- {
- //if ($val['pid'])
- //{
- $db->param_char = '##';
- $db->query("update accounts set pid = NULL,killed = 1,next_action_run=0,next_action=DATE_SUB(DATE_FORMAT(NOW(),'%Y-%m-%d %H:%i:%s'), INTERVAL 5 MINUTE) ,last_proc_time=now() where id =" . $val['id']);
- $db->param_char = '%';
- // print $val['pid'] . ':' . $val['md5id'] ." Killed by killsleep ". date_time('full') ."\n";
- print date_time('full') . '|'. $val['md5id'] . '|' . $val['mysqlid']. '|' .$val['pid'].PHP_EOL;
- if ($val['pid'])
- {
- exec('mysql --user="root" --password="*******PASS************" --execute="kill '.$val['mysqlid'].';" > /dev/null 2>&1');
- exec('kill -9 ' . $val['pid'] . ' > /dev/null 2>&1');
- }
- }
- sleep(60);
- } while (true);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement