我可以使用 wget 运行 本地文件作为 cron 作业使用 public_html 以上的相对路径吗?
Can I use wget to run a local file as a cron job using relative path above public_html?
我正在尝试在 cron 作业中设置 运行 的脚本,我希望它每天 运行 一次。我是 cron 工作的新手,到目前为止我看到的工作只使用绝对路径,如:
http://example.com/path/to/file.
这是我想在 cpanel 中执行的命令:
/usr/bin/wget -O - -q -t 1 /home/account/invest/controllers/cron_controller.php
这行得通吗?还是其他命令比 wget 更好?
最好的命令是php /home/account/invest/controllers/cron_controller.php
。
我正在尝试在 cron 作业中设置 运行 的脚本,我希望它每天 运行 一次。我是 cron 工作的新手,到目前为止我看到的工作只使用绝对路径,如:
http://example.com/path/to/file.
这是我想在 cpanel 中执行的命令:
/usr/bin/wget -O - -q -t 1 /home/account/invest/controllers/cron_controller.php
这行得通吗?还是其他命令比 wget 更好?
最好的命令是php /home/account/invest/controllers/cron_controller.php
。