作者:我似1998 | 来源:互联网 | 2023-05-18 13:35
WellIamnewtothetermCRON.WhatIknowaboutthis,itisaUnixconcepttoscheduleparticular
Well I am new to the term CRON
. What I know about this, it is a Unix
concept to schedule particular operation to be executed after a defined time interval.
我是CRON这个词的新成员。我所知道的是,这是一个Unix概念,它将特定的操作安排在定义的时间间隔之后执行。
I need to run a php
file, to update database once every hour. But my confusion is with scheduling the execution. I am using XAMPP
for local development test on Windows 7.
我需要运行一个php文件,每小时更新一次数据库。但我的困惑是如何安排执行。我正在使用XAMPP进行Windows 7的本地开发测试。
What I found:
我发现:
- How to run a php file as a cron job in cPanel in Bigrock Shared Hosting service?
- 如何在Bigrock共享托管服务的cPanel中作为cron作业运行php文件?
- Setting Up A Cronjob In Windows Xampp
- 在Windows Xampp中设置Cronjob
- How to create cron job using PHP?
- 如何使用PHP创建cron作业?
In all the above links, they are saying to configure a cron
job on linux shell level. So is it, that the cron is on OS level and not on application level program.
在上面的所有链接中,他们说要在linux shell级别上配置cron作业。cron是在OS级别上,而不是在应用程序级别上。
If yes, then how can I create a cron in php on a shared hosting.? If I do not have access to the command line, then I cannot create a Cron job for php.?
如果是,那么如何在共享主机上创建php的cron。如果我不能访问命令行,那么我就不能为php创建Cron作业。
If no, then how?
如果没有,那么如何?
In all the above example I found one similar fashion of code:
在上面的所有示例中,我发现了一种类似的代码方式:
0 * * * * cd C:/xampp/htdocs/plugins/moviefeed/ && php cron.php
What is this *
for?
这是做什么用的?
1 个解决方案