开发者

Would this cron code work? [closed]

Closed. This question is off-topic. It is not currently accepting answers.

Want to improve this question? Update the question so it's on-topic for Stack Overflow.

Closed 11 years ago.

开发者_如何学JAVA Improve this question

I just wanted someone to check this cron code for me, and let me know where to type it so that it will run on my website:

0 23,59 ? * MON-SUN http://mywebsite.com/phpscript.php 

run at 11:59pm every day

0 23,59 ? * MON http://mywebsite.com/phpscript.php 

run at 11:59pm on monday of every week

0 23,59 ? * 1 1-12 http://mywebsite.com/phpscript.php 

run at 11:59pm on the first of every month

Would this code work? The command being run is the request to that webpage which would run that script.


No.

To get you started, the following cron entry will run every day at 11:59pm.

59 23 * * * wget http://mywebsite.com/phpscript.php

I'd strongly encourage you to read a tutorial.


No, because cron doesn't know what to do with an http address - it's got to be an actual command.

You could use wget to pull from the http address - ie, instead of just having the address as the command, put wget http://mywebsite.com/phpscript.php


No. You should use

wget http://addr

or better

php /home/.../path/to/script/script.php


The entries need to go in the crontab.

You'll need to use a program like wget, curl or some such to actually request the page you've specified.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜