创建没有Cron作业的计划任务 [英] creating schedule task without Cron job
问题描述
计划任务需要创建,但不可能使用Cron作业(从托管服务提供商有一个警告,在45分钟内运行cron作业超过一次是违反他们的规则,可能导致关闭帐户。
Scheduled task needs to be created but its not possible to use Cron job (there is a warning from hosting provider that "running the cron Job more than once within a 45-minute period is a infraction of their rules and could result in shutting down the account."
php脚本(从txt到mysql数据库插入数据)应该每分钟执行一次,即此链接应该调用 http://www.myserver。 com / ImportCumulusFile.php?type = dayfile& key = letmein& table = Dayfile& file =。/ data / Jan10log.txt
php script (which insert data from txt to mysql database) should be executed every minute, ie this link should be called http://www.myserver.com/ImportCumulusFile.php?type=dayfile&key=letmein&table=Dayfile&file=./data/Jan10log.txt
方式?
推荐答案
有多种方式可以做重复性工作,我可以立即想到的方法有: / p>
There are multiple ways of doing repetitive jobs. Some of the ways that I can think about right away are:
- Using: https://www.setcronjob.com/
使用这样的外部网站以设定的间隔触发您的网址
Use an external site like this to fire off your url at set intervals
-
使用元刷新。更多这里。
Javascript / Ajax refresh。类似于上面的例子。
Javascript/Ajax refresh. Similar to the above example.
设置cron作业。大多数共享主机确实提供了一种设置cron作业的方法。看看您的托管的cPanel。
Setting up a cron job. Most shared hosting do provide a way to set up cron jobs. Have a look at the cPanel of your hosting.
这篇关于创建没有Cron作业的计划任务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!