1
我从远程服务器获取一些数据并将其提供给我的网站数据库。它有900k条记录(应用程序),但插入的记录仅停止60,180条记录。我们使用mailto
和异常处理程序来查找错误但没有响应。如何查找cron作业中是否超时或错误?
任何人都可以提供关于如何获取cron超时的建议,或者我们的代码中有代码错误吗?
<?php
set_time_limit(0);
ignore_user_abort();
try
{
$ch = curl_init();
// set URL and other appropriate options
curl_setopt($ch, CURLOPT_URL, "http://ks329xxx.com/cronRU/update");
curl_setopt($ch, CURLOPT_HEADER, 0);
// grab URL and pass it to the browser
curl_exec($ch);
// close cURL resource, and free up system resources
curl_close($ch);
}
catch (Exception $e)
{
echo 'Caught exception: ', $e->getMessage(), "\n";
mail('[email protected]', 'update', $message);
}
?>
我编辑您的文章一点 - 每当有人提到了[十万(http://en.wikipedia.org/wiki /拉赫)它会导致混乱:) – 2013-03-20 13:04:29