如何使用 cronjobs 在租用的服务器上 运行 一个 php 文件
How to run a php file on a rented server using cronjobs
我有一个域名。在所述域中,我隐藏了一个随机化 table 的文件。 public_html/games/gamename/scripts/random.php
从我租用服务器的公司的文件管理软件中得到的
我想设置一个 cron 作业,每 30 分钟 运行 这个文件一次。我以前从未使用过 CRON。
我的问题:
A: Is there a better way to confirm that the address of the file is the correct one for this action.
B: What is the cron code I would use to run the file?
谢谢!
更新我的答案 --
我刚刚在 cPanel 中设置了一个,这就是我要做的工作:
php -f /home/cpanel_username/public_html/path/file.php
对我来说效果很好。
我有一个域名。在所述域中,我隐藏了一个随机化 table 的文件。 public_html/games/gamename/scripts/random.php
从我租用服务器的公司的文件管理软件中得到的
我想设置一个 cron 作业,每 30 分钟 运行 这个文件一次。我以前从未使用过 CRON。
我的问题:
A: Is there a better way to confirm that the address of the file is the correct one for this action. B: What is the cron code I would use to run the file?
谢谢!
更新我的答案 --
我刚刚在 cPanel 中设置了一个,这就是我要做的工作:
php -f /home/cpanel_username/public_html/path/file.php
对我来说效果很好。