I've a php script which runs from webservice and insert to DB.
crontab -e
......other cron tasks above....... ... .. .. # Run test script.php at 1610 10 16 * * * /usr/bin/wget -q -O /home/username/my_cronjobs/logs/cron_adhoc http://localhost/project/script.php
Apparently, at 16:10, this script is run twice! 16:10:01 and 16:25:02
Is it something wrong and gotta do with using wget?? Or did i set the schedule on cron job wrongly?
When i run http://localhost/project/script.php from browser, it will only run once..
Any idea regarding this problem ?
I've tested, there are no other users running the same job... I suspect the way wget works.
As my script needs at least 20mins to complete without sending back a response (it is pulling alot of data from webservicces and save to db) .. suspect there's a time out or retry of wget by default causing this problem.
i think i solve my own question.
My php takes some time to load, i guess wget retries or time out after some default specified time.
I solved it by using /usr/bin/php
The wget docs give a default read-timeout of 900 seconds, or 15 minutes.
This is why you were seeing the file called again 15 minutes later. You can specify a longer read-timeout by adding the parameter and an appropriate number of seconds:
Whose user's crontab is this?
Check if there is another user for which you set up cron job at different time and forgot about it.