我想创建一个cronjob,每隔X次打开一个网页。

此网页受.htaccess密码保护(用户= admin,passwor = pass)。我给出的说明如下:

wget --user=admin --password='pass' http://www.mywebsite.com/test.php

但是cron给我以下错误:
--2012-05-02 10:14:01--  http://www.mywebsite.com/test.php
Resolving www.mywebsite.com... IP
Connecting to www.mywebsite.com|IP|:80... connected.
HTTP request sent, awaiting response... 401 Authorization Required
Reusing existing connection to www.mywebsite.com:80.
HTTP request sent, awaiting response... 403 Forbidden
2012-05-02 10:14:01 ERROR 403: Forbidden.

我也尝试过做:
wget admin:pass@http://www.mywebsite.com/test.php

但是有类似的错误。我该如何解决?预先感谢您的帮助。

最佳答案

您正在犯一个小错误。

在网址前保留 http://

你有



更改为



希望能奏效。

10-08 06:42