Fake Cron job setup... how to run runcrawl.php via php!
« on: March 26, 2011, 05:15:41 PM »
Hi,
is there a way to activate the runcrawl.php via php directly without logging in?
Because I need to crawl my website every day (due to multiples news posted) and I don't always have time to log (sometimes I'm not even in front of a computer).

Calling the runcrawl.php directly via browser returns with "This tool can be executed in command line mode only"


Thank you in advance!
Re: Fake Cron job setup... how to run runcrawl.php via php!
« Reply #1 on: March 26, 2011, 06:17:49 PM »
Well, I've found the answer myself:

Just create a file (like fakecron.php) and, after the right code to start whenever you want, put this:

$command = "cd /var/www/vhosts/WWW.YOURWEBSITE.COM/httpdocs/generator/; php -q runcrawl.php";

$test = shell_exec($command);

(works on linux with safe_mode off)
 
Obviously there's more code to add, but a normal php programmer can do it by himself.

Thanks,
M