PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
I have a script that scans thousands of ips and puts the results in a database. I have tested it to scan up to 250 ips and it works well, but very slow. According to my calculations my script needs 2 - 3 days to finish scanning all ips I want it to scan. I can't keep my brouser open the whole time, so I decided to use "cron jobs". I'm using the comand "php -q /path_to_script/script.php", but 12 hours after the time it was assigned the database is still empty. Is it posiible, the reason for this to be in the cron job program on the server or in the php program?
astions wrote:I'm not sure what your doing is ethical.
Well I'm not sure either. Personaly I would code this in C++ and run it from a payed shell account, but this is a task assigned to me by someone else. He wants it to be coded in php, so it can run on his server. He gave me a script that was scanning a couple of ips, and I have to 1)make it scan whole ranges and 2)set everything up on his server. I dont want to waste your time on improving my code. I think I did this already. I want to know only if it is possible the "cron job" or the "php" to have some kind of time limit. For example the kernel decides that php -q is not respondin because it is runnin for whole hour and stops it before it has added anything in the database.