Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I have a php script that grabs links from another website. I am storing these links in my local system database using wamp server but my internet speed is so slow. I have to refresh the php script in browser after every 10 records.

So, can I run this PHP script on my webhosting server continuously for 24 hours and store all the links same as my local system. If it is possible then please help me.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
141 views
Welcome To Ask or Share your Answers For Others

1 Answer

Type in crontab -e in the/a terminal or through PuTTy on your server, enter something to the like of the code below, where m is minutes, h is hours, dom is days of the month, etc etc etc

# m   h       dom     mon     dow     command
*/5   *       *       *       *       php -f /directory/to/file/filename.php

This will run it every five minutes.

If you want to run it continuously (which it doesn't really do), it needs to be run piece wise, something like this would work, which would run it from 9.30-17.30 every day.

30-59/5 9 * * * script.sh
*/5 10-16 * * * script.sh
0-30/5 17 * * * script.sh

Here are the basics of cron, I suggest you read them.

Cron and Crontab


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...