使用wget创建cron作业时遇到问题。 当我使用此命令时:
wget -U http://example.com/wp-content/plugins/plugin_name/export.php
我收到此消息:
--2013-11-21 11:29:01-- http://example.com/wp-content/plugins/plugin_name/export.php
Resolving example.com... 255.255.255.255
Connecting to example.com|255.255.255.255|:80... connected.
HTTP request sent, awaiting response... 403 Forbidden
2013-11-21 11:29:01 ERROR 403: Forbidden.#
所以我研究了这个并尝试使用浏览器欺骗技巧:
wget -U 'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.6) Gecko/20070802 SeaMonkey/1.1.4' http://example.com/wp-content/plugins/plugin_name/export.php
但是这会回来:
--2013-11-21 11:36:02-- http://example.com/wp-content/plugins/plugin_name/export.php
Resolving example.com... 255.255.255.255
Connecting to example.com|255.255.255.255|:80... connected.
HTTP request sent, awaiting response... 404 Not Found
2013-11-21 11:36:03 ERROR 404: Not Found.
我找不到任何理由发生这种情况,我有点难过。 我没有运行任何代理阻止
答案 0 :(得分:0)
有一个明显的答案。请求返回'403 Forbidden',表示客户端的身份验证丢失/不足,或者服务器端用户的访问权限丢失/不足。
你可以从没有wget的普通浏览器运行请求吗?