简体   繁体   English

如何在cron中使用wget?

[英]How do I use wget in cron?

How do I convert these three cron lines to use wget (or even curl if that's better) instead of php ? 我如何将这三个cron行转换为使用wget (如果更好,甚至使用curl )而不是php These cron items are required to keep Magento 2 up to date. 这些cron项使Magento 2保持最新状态所必需的

* * * * * php -c /home/example/etc/php.ini /home/example/public_html/bin/magento cron:run
* * * * * php -c /home/example/etc/php.ini /home/example/public_html/update/cron.php
* * * * * php -c /home/example/etc/php.ini /home/example/public_html/bin/magento setup:cron:run

Here's as close as I can get to guessing what to do... the middle line seems like it should work but doesn't and I have no idea what to use for the others. 这是我能猜到该怎么做的最接近的方法。中间的一行似乎应该起作用,但是没有用,我也不知道该如何使用其他代码。

* * * * * wget -O /dev/null -q http://www.example.com/???? > /dev/null
* * * * * wget -O /dev/null -q http://www.example.com/update/cron.php > /dev/null
* * * * * wget -O /dev/null -q http://www.example.com/???? > /dev/null

The cron jobs that you are referencing keep the indexes and links within the Magento system up-to-date, not the software itself. 您要引用的cron作业可以使Magento系统中的索引和链接保持最新状态,而不是软件本身。 wget is used to retrieve files and this is not what these cron jobs do. wget用于检索文件,而这不是这些cron作业所做的。

You really do need to let these cron jobs run, since they do trim and keep ordered all of the entropy that is Magento. 您确实确实需要让这些cron作业运行,因为它们会修剪并保持有序的所有Magento熵。

I also think you do not need to specify php.ini explicitly. 我也认为您不需要显式指定php.ini。 Just the path will do. 只是路径会做。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM