I need to run a php script
to generate snapshots
using CutyCapt
of some websites using crone job
, i get websites' addressess from database and then delete this record after generating screenshots.
i used */5 * * * * /usr/bin/php -f /path/generate.php
it didn't worked for crone job
but if i access the same file using browser
it works fine, and if run this script using command php
from command line
it also works fine.
then i just created another file and accessed the url using file_get_contents
; added this file to crone job
it worked fine for some days but now this approach is also not working. i don't know what happened. i didn't change any of these files.
I also tried wget
command to access that url but failed to get required out put.
my crontab is now looks like this
*/5 * * * * wget "http://www.mysite.com/generate.php" -O /dev/null
Strange thing is that crone job executes fine it fetches data from database and deletes record as well but does not update images.
Is there any problem with rights or something similar that prevents it to generate images using crone job but not when accessed using browser.
Please help i am stuck.