活着的解决方案我有一个托管websolution和更新网站信息后台的脚本。保留了cron作业
我的虚拟主机提供商允许cron和我已经提出,wget的对每个小时的脚本。
脚本检查与职位,以更新的最古老更新的帖子和更新数据库表。在脚本的最后,我使用JavaScript刷新再次执行相同的过程,这次是第二个最早更新的帖子,等等,直到所有帖子都运行完毕。如果我在浏览器中打开脚本,它可以正常工作,但是当我的主机设置了cron时,脚本在javascrpt刷新后不会继续。
我如何与另一个刷新解决方案,将工作,直到我的发言只是让cron的启动脚本停止它解决这个问题?
(我改变了这种解决方案从一个地方的所有帖子都在一个页面加载更新,但因为它启动超时我这一去)
的script.php
$limit=3600;
//Select the oldest updated post
if($last_update<$update_to_limit){ //check if the post was updated during this run
// Script that update the post and below the java refresh that repeats the script.
?>
<script type="text/javascript">
<!--
window.location.href = "http://www.site.se/script.php"
//-->
</script>
<?php
}else{
echo 'OK : All posts updated within the last : '.$limit.' s';
}
Cron作业,因为他们不使用浏览器将无法执行JavaScript,他们使用的命令线。 – Gazler 2011-04-10 15:24:56