[英]How to configuration cron job in cpanel
How to configuration Cron Job in cPanel for .PHP
script. 如何在cPanel中为.PHP
脚本配置Cron Job。
I want to run it every day once a day. 我想每天运行一次。
Where i need to store this .php
file ? 我需要在哪里存储此.php
文件?
How can i check whether its working or not ? 我如何检查其是否正常工作?
You can do it through command but since you using cPanel, use the interface: 您可以通过命令来完成,但是由于您使用的是cPanel,因此请使用以下接口:
Then fill out Add New Cron Job 然后填写添加新的Cron作业
For example, a cron for a php script that runs everyday at midnight sharp would look like this 例如,每天下午12点运行的php脚本的cron看起来像这样
Minute Hour Day Month Weekday
0 0 * * * php /path/to/script.php
Click the "Add New Cron Job" button. 单击“添加新的Cron作业”按钮。
Link : 连结:
You may put the file.php
file in the "public_html" folder in your server. 您可以将file.php
文件放在服务器的“ public_html”文件夹中。 You have the option of cron job in the cpanel "Advanced" section. 您可以在“高级”面板中选择cron作业。 Once you're there you have the option to add a new cron job and "common setting" called "Once a day", which will satisfy your need. 在那里,您可以选择添加新的cron作业和称为“每天一次”的“通用设置”,这将满足您的需求。 In the "command" field paste this: wget --spider http://yoursite.com/file.php
and then save. 在“命令”字段中粘贴以下内容: wget --spider http://yoursite.com/file.php
,然后保存。
Of course this is not the best practice, but I hope it will do the job for you. 当然,这不是最佳做法,但我希望它能为您完成这项工作。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.